mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
Fix rect/hexagon not centering properly when holding alt (#121)
This commit is contained in:
parent
722c777ba6
commit
78ff81ffa8
2 changed files with 16 additions and 2 deletions
|
|
@ -143,7 +143,14 @@ fn make_operation(data: &RectangleToolData, tool_data: &DocumentToolData) -> Ope
|
|||
(x0, y0, x0 + max_dist * x_dir, y0 + max_dist * y_dir)
|
||||
}
|
||||
} else {
|
||||
let (x0, y0) = if data.center_around_cursor { (x0 - 2.0 * (x1 - x0), y0 - 2.0 * (y1 - y0)) } else { (x0, y0) };
|
||||
let (x0, y0) = if data.center_around_cursor {
|
||||
let delta_x = x1 - x0;
|
||||
let delta_y = y1 - y0;
|
||||
|
||||
(x0 - delta_x, y0 - delta_y)
|
||||
} else {
|
||||
(x0, y0)
|
||||
};
|
||||
(x0, y0, x1, y1)
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,14 @@ fn make_operation(data: &ShapeToolData, tool_data: &DocumentToolData) -> Operati
|
|||
(x0, y0, x0 + max_dist * x_dir, y0 + max_dist * y_dir)
|
||||
}
|
||||
} else {
|
||||
let (x0, y0) = if data.center_around_cursor { (x0 - 2.0 * (x1 - x0), y0 - 2.0 * (y1 - y0)) } else { (x0, y0) };
|
||||
let (x0, y0) = if data.center_around_cursor {
|
||||
let delta_x = x1 - x0;
|
||||
let delta_y = y1 - y0;
|
||||
|
||||
(x0 - delta_x, y0 - delta_y)
|
||||
} else {
|
||||
(x0, y0)
|
||||
};
|
||||
(x0, y0, x1, y1)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue