forked from 1b-agent/opencadstudio-upstream
fix(section): add state grip menu
This commit is contained in:
1 parent
78bbd1065a
commit
0426df79ca
5 files changed
+104
-17
No files matched your search
@@ -98,6 +98,8 @@ pub enum GripShape {
|
||||
Circle,
|
||||
/// Screen-offset menu selector.
|
||||
Dropdown,
|
||||
/// Menu selector placed immediately beside its anchor grip.
|
||||
DropdownAdjacent,
|
||||
}
|
||||
|
||||
/// Describes one grip point for an entity.
|
||||
@@ -180,6 +182,10 @@ pub enum GripMenuAction {
|
||||
RefineVertices,
|
||||
ShowFit,
|
||||
ShowControlVertices,
|
||||
SectionPlane,
|
||||
SectionSlice,
|
||||
SectionBoundary,
|
||||
SectionVolume,
|
||||
MoveWithText,
|
||||
StackText,
|
||||
UnstackText,
|
||||
|
||||
+10
-3
@@ -13,11 +13,18 @@ pub const GRIP_HALF_PX: f32 = 5.0;
|
||||
/// Screen offset for dropdown selectors anchored to a vertex.
|
||||
pub const GRIP_DROPDOWN_OFFSET_X_PX: f32 = 24.0;
|
||||
pub const GRIP_DROPDOWN_OFFSET_Y_PX: f32 = 27.0;
|
||||
pub const GRIP_ADJACENT_DROPDOWN_OFFSET_X_PX: f32 = 12.0;
|
||||
|
||||
fn marker_screen_position(mut point: Point, shape: GripShape) -> Point {
|
||||
if shape == GripShape::Dropdown {
|
||||
point.x += GRIP_DROPDOWN_OFFSET_X_PX;
|
||||
point.y += GRIP_DROPDOWN_OFFSET_Y_PX;
|
||||
match shape {
|
||||
GripShape::Dropdown => {
|
||||
point.x += GRIP_DROPDOWN_OFFSET_X_PX;
|
||||
point.y += GRIP_DROPDOWN_OFFSET_Y_PX;
|
||||
}
|
||||
GripShape::DropdownAdjacent => {
|
||||
point.x += GRIP_ADJACENT_DROPDOWN_OFFSET_X_PX;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
point
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user