()
| 198 | public Viewport() { |
| 199 | this.properties.putToList(Drawing.lateDrawers, this::drawNow); |
| 200 | this.properties.put(scene, new Scene()); |
| 201 | Camera camera = new Camera(); |
| 202 | this.properties.put(Viewport.camera, camera); |
| 203 | standard = new Standard(camera); |
| 204 | this.properties.put(clips, true); |
| 205 | |
| 206 | this.properties.putToMap(FLineDrawing.frameDrawing, "__outline__", new Cached<Box, Object, FLine>((box, previously) -> { |
| 207 | Rect rect = box.properties.get(frame); |
| 208 | if (rect == null) return null; |
| 209 | |
| 210 | boolean selected = box.properties.isTrue(Mouse.isSelected, false); |
| 211 | |
| 212 | FLine f = new FLine(); |
| 213 | if (selected) rect = rect.inset(-8f); |
| 214 | else rect = rect.inset(-0.5f); |
| 215 | |
| 216 | f.moveTo(rect.x, rect.y); |
| 217 | f.lineTo(rect.x + rect.w, rect.y); |
| 218 | f.lineTo(rect.x + rect.w, rect.y + rect.h); |
| 219 | f.lineTo(rect.x, rect.y + rect.h); |
| 220 | f.lineTo(rect.x, rect.y); |
| 221 | |
| 222 | f.attributes.put(strokeColor, selected ? new Vec4(0, 0, 0, -1.0f) : new Vec4(0, 0, 0, 0.5f)); |
| 223 | f.attributes.put(thicken, new BasicStroke(selected ? 16 : 1.5f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER)); |
| 224 | f.attributes.put(stroked, true); |
| 225 | |
| 226 | return f; |
| 227 | }, (box) -> new Pair(box.properties.get(frame), box.properties.get(Mouse.isSelected)))); |
| 228 | |
| 229 | this.properties.putToMap(FLineDrawing.frameDrawing, "__outlineFill__", new Cached<Box, Object, FLine>((box, previously) -> { |
| 230 | Rect rect = box.properties.get(frame); |
| 231 | if (rect == null) return null; |
| 232 | |
| 233 | boolean selected = box.properties.isTrue(Mouse.isSelected, false); |
| 234 | |
| 235 | FLine f = new FLine(); |
| 236 | if (selected) rect = rect.inset(-8f); |
| 237 | else rect = rect.inset(-0.5f); |
| 238 | |
| 239 | f.moveTo(rect.x, rect.y); |
| 240 | f.lineTo(rect.x + rect.w, rect.y); |
| 241 | f.lineTo(rect.x + rect.w, rect.y + rect.h); |
| 242 | f.lineTo(rect.x, rect.y + rect.h); |
| 243 | f.lineTo(rect.x, rect.y); |
| 244 | |
| 245 | f.attributes.put(stroked, false); |
| 246 | f.attributes.put(fillColor, new Vec4(0, 0, 0, 0.2f)); |
| 247 | f.attributes.put(filled, true); |
| 248 | |
| 249 | return f; |
| 250 | }, (box) -> new Pair(box.properties.get(frame), box.properties.get(Mouse.isSelected)))); |
| 251 | |
| 252 | pointHitTest = new FLinePointHitTest(new FLinePointHitTest.Transformer() { |
| 253 | public Rect f; |
| 254 | public Mat4 t; |
| 255 | |
| 256 | @Override |
| 257 | public boolean begin(Window.Event<Window.MouseState> provokedBy) { |
no test coverage detected