File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
invokeai/frontend/web/src/features/controlLayers/konva Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -241,11 +241,7 @@ export class CanvasStageModule extends CanvasModuleBase {
241
241
* Constrains a scale to be within the valid range
242
242
*/
243
243
constrainScale = ( scale : number ) : number => {
244
- // Round to 2 decimal places to avoid floating point precision issues
245
- const rounded = Math . round ( scale * 100 ) / 100 ;
246
- const clamped = clamp ( rounded , this . config . MIN_SCALE , this . config . MAX_SCALE ) ;
247
-
248
- return clamped ;
244
+ return clamp ( scale , this . config . MIN_SCALE , this . config . MAX_SCALE ) ;
249
245
} ;
250
246
251
247
/**
@@ -264,8 +260,8 @@ export class CanvasStageModule extends CanvasModuleBase {
264
260
const deltaX = ( _center . x - x ) / oldScale ;
265
261
const deltaY = ( _center . y - y ) / oldScale ;
266
262
267
- const newX = Math . floor ( _center . x - deltaX * newScale ) ;
268
- const newY = Math . floor ( _center . y - deltaY * newScale ) ;
263
+ const newX = _center . x - deltaX * newScale ;
264
+ const newY = _center . y - deltaY * newScale ;
269
265
270
266
this . konva . stage . setAttrs ( {
271
267
x : newX ,
You can’t perform that action at this time.
0 commit comments