Skip to content

Commit

Permalink
Change the zoom slider to operate in realtime
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Oct 9, 2023
1 parent 6813454 commit 8b8d306
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/lib/views/zoom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class _ZoomViewState extends State<ZoomView> with TickerProviderStateMixin {
final hideZoom = !settings.zoomEnabled ||
settings.fullScreen ||
currentIndexCubit.state.hideUi != HideState.visible;
void zoom(double value) {
void zoom(double value, [bool bake = true]) {
final state = context.read<DocumentBloc>().state;
if (state is! DocumentLoaded) {
return;
Expand All @@ -85,7 +85,9 @@ class _ZoomViewState extends State<ZoomView> with TickerProviderStateMixin {
(viewport.height ?? 0) / 2,
);
context.read<TransformCubit>().size(value, center);
currentIndexCubit.bake(state.data, state.page, state.info);
if (bake) {
currentIndexCubit.bake(state.data, state.page, state.info);
}
if ((!_focusNode.hasFocus && widget.isMobile) || hideZoom) {
_controller.reverse();
}
Expand Down Expand Up @@ -129,8 +131,7 @@ class _ZoomViewState extends State<ZoomView> with TickerProviderStateMixin {
value: scale.clamp(kMinZoom, 10),
min: kMinZoom,
max: 10,
onChanged: (value) =>
setState(() => scale = value),
onChanged: (value) => zoom(value, false),
onChangeEnd: zoom,
),
),
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/74.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Change file name when changing document name in the title bar
* Change the zoom slider to operate in realtime

View all changes in the blog: https://linwood.dev/butterfly/2.0.0-beta.10

0 comments on commit 8b8d306

Please sign in to comment.