bluefireteam / photo_view

📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.
MIT License
1.91k stars 547 forks source link

feature/strictscale: add possibility to restrict user scale, fix issue #85 #537

Closed EArminjon closed 1 year ago

EArminjon commented 1 year ago

Actual behavior : User can scale image in or out. When user release scale gesture, app will rescale if current user scale choice is behind defined limit (maxScale and minScale).

Proposition : A new property to prevent the user to scale behind theses limit.

EArminjon commented 1 year ago

Ready

EArminjon commented 1 year ago

@renancaraujo can you take a look please :'( ?

renancaraujo commented 1 year ago

We have wey too many proeprties on those widgets, we will have to do a cleanup eventually

EArminjon commented 1 year ago

@renancaraujo do you plan to release soon this PR on pub dev :) ?

EArminjon commented 1 year ago

@renancaraujo seems like the auto deployment didn't push the new version on pub dev. Do you plan it soon :'( ?

EArminjon commented 1 year ago

@renancaraujo please :'(

EArminjon commented 1 year ago

@renancaraujo ?

phamconganh commented 1 year ago

@EArminjon strictScale makes it impossible to scale back to minScale. Example: minScale 1, but only zoomOut to 1.0043980003016804. I think clamp newScale and update if different from previous scale at line code:

    if (widget.strictScale && (newScale > widget.scaleBoundaries.maxScale ||
        newScale < widget.scaleBoundaries.minScale)) {
      return;
    }
EArminjon commented 1 year ago

@EArminjon strictScale makes it impossible to scale back to minScale. Example: minScale 1, but only zoomOut to 1.0043980003016804. I think clamp newScale and update if different from previous scale at line code:

    if (widget.strictScale && (newScale > widget.scaleBoundaries.maxScale ||
        newScale < widget.scaleBoundaries.minScale)) {
      return;
    }

Create an issue with reproductible steps please. Commenting merged PR is not a good practice.