diff --git a/app/lib/handlers/handler.dart b/app/lib/handlers/handler.dart index c815d6cc5452..2ba048e6a9c3 100644 --- a/app/lib/handlers/handler.dart +++ b/app/lib/handlers/handler.dart @@ -483,10 +483,8 @@ mixin PointerManipulationHandler on Handler { static Offset calculatePointerPosition( CurrentIndex index, Offset position, Size viewportSize) { return index.toggleableHandlers.values - .whereType() - .map((e) => e.getPointerPosition(position, viewportSize)) - .where((e) => e != position) - .firstOrNull ?? - position; + .whereType() + .fold(position, + (pos, handler) => handler.getPointerPosition(pos, viewportSize)); } } diff --git a/app/lib/handlers/ruler.dart b/app/lib/handlers/ruler.dart index 745f88a92c05..2021b1fdc747 100644 --- a/app/lib/handlers/ruler.dart +++ b/app/lib/handlers/ruler.dart @@ -7,14 +7,14 @@ Rect _getRulerRect(Size size, Offset position, transform.position.dx + position.dx / transform.size, transform.position.dy + (size.height / 2 + -rulerSize / 2 + position.dy) / transform.size, - size.width / transform.size, + size.width * 2 / transform.size, rulerSize / transform.size, ); } class RulerHandler extends Handler with PointerManipulationHandler { Offset _position = Offset.zero; - double _rotation = 20; + double _rotation = 0; Offset get position => _position; double get rotation => _rotation; @@ -140,10 +140,11 @@ class RulerRenderer extends Renderer { // Paint ruler lines int x = steps; var even = (transform.position.dx ~/ (steps / transform.size)) % 2 == 0; - while (x <= size.width * transform.size) { + while (x <= size.width * transform.size * 2) { final posX = x / transform.size - (transform.position.dx % (steps / transform.size)) - - size.width / 2; + size.width / 2 - + rulerRect.width / 4; canvas.drawLine( Offset(posX, rulerRect.top), Offset( diff --git a/app/lib/handlers/select.dart b/app/lib/handlers/select.dart index e536a351d290..f9d4a66ebe08 100644 --- a/app/lib/handlers/select.dart +++ b/app/lib/handlers/select.dart @@ -348,7 +348,6 @@ class SelectHandler extends Handler { @override void onScaleUpdate(ScaleUpdateDetails details, EventContext context) { - print("onScaleUpdate"); final globalPos = context.getCameraTransform().localToGlobal(details.localFocalPoint); if (_handleRuler(details, context)) {