forked from 1b-agent/opencadstudio-upstream
Merge remote-tracking branch 'origin/main' into merge-test/main-into-constraints
# Conflicts: # src/app/command_driver.rs # src/command.rs # src/ui/ribbon/mod.rs # src/ui/window/options.rs
This commit is contained in:
commit
ad718def3f
124 files changed
+9866
-692
No files matched your search
+24
-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
|
||||
}
|
||||
@@ -47,6 +54,8 @@ pub struct GripEdit {
|
||||
pub enum GripEditMode {
|
||||
Stretch,
|
||||
Lengthen,
|
||||
Radius,
|
||||
ArcLength,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -85,6 +94,18 @@ impl GripEdit {
|
||||
edit.mode = GripEditMode::Lengthen;
|
||||
edit
|
||||
}
|
||||
|
||||
pub fn radius(handle: Handle, grip_id: usize, world: DVec3) -> Self {
|
||||
let mut edit = Self::single(handle, grip_id, false, world);
|
||||
edit.mode = GripEditMode::Radius;
|
||||
edit
|
||||
}
|
||||
|
||||
pub fn arc_length(handle: Handle, grip_id: usize, world: DVec3) -> Self {
|
||||
let mut edit = Self::single(handle, grip_id, false, world);
|
||||
edit.mode = GripEditMode::ArcLength;
|
||||
edit
|
||||
}
|
||||
}
|
||||
|
||||
// ── Screen-space helpers ───────────────────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user