File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,10 @@ impl Fsm for SelectToolFsmState {
129
129
( Some ( [ pos1, pos2] ) , path) => {
130
130
let path = path. unwrap_or_else ( || add_boundnig_box ( responses) ) ;
131
131
data. bounding_box_id = Some ( path. clone ( ) ) ;
132
- let transform = transform_from_box ( pos1, pos2) ;
132
+ let half_pixel_offset = DVec2 :: splat ( 0.5 ) ;
133
+ let start = pos1 + half_pixel_offset;
134
+ let size = pos2 - start + half_pixel_offset;
135
+ let transform = transform_from_box ( start, size) ;
133
136
Operation :: SetLayerTransformInViewport { path, transform } . into ( )
134
137
}
135
138
( _, _) => Message :: NoOp ,
@@ -179,7 +182,7 @@ impl Fsm for SelectToolFsmState {
179
182
}
180
183
( DrawingBox , MouseMove ) => {
181
184
data. drag_current = input. mouse . position ;
182
- let half_pixel_offset = DVec2 :: new ( 0.5 , 0.5 ) ;
185
+ let half_pixel_offset = DVec2 :: splat ( 0.5 ) ;
183
186
let start = data. drag_start + half_pixel_offset;
184
187
let size = data. drag_current - start + half_pixel_offset;
185
188
You can’t perform that action at this time.
0 commit comments