Graphite icon indicating copy to clipboard operation
Graphite copied to clipboard

Quick measurement overlays while holding the Alt key

Open Keavon opened this issue 1 year ago • 0 comments

The first basic implementation of this was added in #1894, now this issue is about improving it so it matches the spec described below.

When holding the Alt key with a layer (or multiple) selected, while hovering over another layer (or group), an overlay should appear visualizing the AABB of both the selected and hovered layers, with lines and distance numbers (in document coordinates) between them as shown below.

When the document is viewed with a tilt in the viewport PTZ navigation, the lines become angled but the text labels stay upright for readability.

Here are, I believe, all the scenarios. The three diagrams with text do care about which is the selected layer and which is the hovered layer; all the others are drawn the same in either order, so it doesn't matter which is the selected or hovered one. The two colored boxes represent AABBs, not actual shapes in the artwork— those should be drawn with a blue outline around both their AABBs.

Scenarios
Terminology definitions:

- "Boxes overlap along 0/1/2 axes" means extruding the box's edge infinitely left/right, or up/down, would hit the other box
- "0/1/2 of their centerlines cross the other boxes" means extending both box's center points infinitely left/right, or up/down, would hit the other box
- "Along axis A/B" means either the X and Y, or the Y and X, axes
- "box A/B" means either one particular box and its opposite, or the reverse

Boxes overlap along 0 axes:

image
Boxes overlap along 1 axis and 0 of their centerlines cross the other boxes:

image
Boxes overlap along 1 axis and 2 of their centerlines cross the other boxes:

image
Boxes overlap along 1 axis and 1 of their centerlines cross the other boxes:

image
Boxes overlap along 2 axes and:
- Along axis A, box A has 1 edge line cross box B while box B has 1 edge line cross box A
- Along axis B, box A has 1 edge line cross box B while box B has 1 edge line cross box A

capture
Boxes overlap along 2 axes and:
- Along axis A, box A has 1 edge line cross box B while box B has 1 edge line cross box A
- Along axis B, box A has 2 edge lines cross box B while box B has 0 edge lines cross box A

capture
Boxes overlap along 2 axes and:
- Along axis A, box A has 2 edge lines cross box B while box B has 0 edge lines cross box A
- Along axis B, box A has 0 edge lines cross box B while box B has 2 edge lines cross box A

capture
Boxes overlap along 2 axes and:
- Along axis A, box A has 2 edge lines cross box B while box B has 0 edge lines cross box A
- Along axis B, box A has 1 edge line cross box B while box B has 1 edge line cross box A

capture
Boxes overlap along 2 axes and:
- Along axis A, box A has 2 edge lines cross box B while box B has 0 edge lines cross box A
- Along axis B, box A has 2 edge lines cross box B while box B has 0 edge lines cross box A

capture

Diagram source file: Quick Measurement Overlays Design.graphite.txt

Keavon avatar Aug 05 '24 09:08 Keavon