Skip to content

zoomIn(step) overshoots defined scale when smooth: true is enabled #545

@madsone

Description

@madsone

Describe the bug
When using zoomIn(0.25) with smooth: true enabled in TransformWrapper, the resulting scale overshoots the expected increment. For example, instead of increasing by exactly 0.25, the scale jumps by approximately 0.28.

To Reproduce
Steps to reproduce the behavior:

  1. Wrap content in
  2. Call zoomIn(0.25) from a button or event
  3. Observe the resulting scale in onTransformed or useTransformEffect
  4. See that the scale is not exactly +0.25 from the previous value

Expected behavior
The scale should increase by exactly the defined step (e.g. +0.25) when zoomIn(step) is called, regardless of smoothing.

Screenshots

Image Image

Desktop (please complete the following information):

  • MacOS: 15.6.1 (24G90)
  • Chrome
  • 139.0.7258.155

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions