Skip to content

Commit

Permalink
Gate the gesture-driven calls to set_zoom_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
baskerville committed May 20, 2019
1 parent ad33aa7 commit ac52841
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Swipe north/south to scroll the page stream when the zoom mode is fit-to-width.

Rotate to change the screen orientation (one finger is the center, the other describes the desired rotation with a circular motion around the center: the two fingers should land and take off simultaneously).

Spread horizontally to switch the zoom mode to fit-to-width.
Spread (resp. pinch) horizontally to switch the zoom mode to fit-to-width (resp. fit-to-page).

## Bottom bar

Expand Down
11 changes: 10 additions & 1 deletion src/view/reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,16 @@ impl View for Reader {
true
},
Event::Gesture(GestureEvent::Spread { axis: Axis::Horizontal, starts, .. }) if self.rect.includes(starts[0]) => {
self.set_zoom_mode(ZoomMode::FitToWidth, hub);
if !self.reflowable {
self.set_zoom_mode(ZoomMode::FitToWidth, hub);
}
true

},
Event::Gesture(GestureEvent::Pinch { axis: Axis::Horizontal, starts, .. }) if self.rect.includes(starts[0]) => {
if !self.reflowable {
self.set_zoom_mode(ZoomMode::FitToPage, hub);
}
true

},
Expand Down

0 comments on commit ac52841

Please sign in to comment.