Skip to content

Commit

Permalink
Fix aspect ratio label in area tool selection view
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Dec 13, 2024
1 parent 64bdb79 commit ec2c9d2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/lib/cubits/current_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ class CurrentIndexCubit extends Cubit<CurrentIndex> {
document,
page,
info,
transform: transform,
transform: renderTransform,
states: state.allRendererStates,
resolution: resolution,
cameraViewport: cameraViewport.unbake(
Expand All @@ -627,7 +627,7 @@ class CurrentIndexCubit extends Cubit<CurrentIndex> {
document,
page,
info,
transform: transform,
transform: renderTransform,
states: state.allRendererStates,
resolution: resolution,
cameraViewport: cameraViewport.unbake(
Expand Down
5 changes: 4 additions & 1 deletion app/lib/cubits/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@ class ButterflySettings with _$ButterflySettings, LeapSettings {
? OptionsPanelPosition.values
.byName(prefs.getString('options_panel_position')!)
: OptionsPanelPosition.top,
renderResolution: prefs.containsKey('render_resolution') ? RenderResolution.values.byName(prefs.getString('render_resolution')!) : RenderResolution.normal,
renderResolution: prefs.containsKey('render_resolution')
? RenderResolution.values
.byName(prefs.getString('render_resolution')!)
: RenderResolution.normal,
);
}

Expand Down
1 change: 0 additions & 1 deletion app/lib/selections/tools/area.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class AreaToolSelection extends ToolSelection<AreaTool> {
Expanded(
child: Text(
AppLocalizations.of(context).aspectRatio,
textAlign: TextAlign.center,
),
),
MenuAnchor(
Expand Down
19 changes: 12 additions & 7 deletions app/lib/settings/behaviors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ class BehaviorsSettingsPage extends StatelessWidget {
StartupBehavior.openNewNote => AppLocalizations.of(context).newNote,
};

String _getRenderResolutionName(BuildContext context, RenderResolution value) =>
String _getRenderResolutionName(
BuildContext context, RenderResolution value) =>
switch (value) {
RenderResolution.performance => AppLocalizations.of(context).performance,
RenderResolution.performance =>
AppLocalizations.of(context).performance,
RenderResolution.normal => AppLocalizations.of(context).normal,
RenderResolution.high => AppLocalizations.of(context).high,
};
Expand All @@ -30,7 +32,8 @@ class BehaviorsSettingsPage extends StatelessWidget {
switch (value) {
RenderResolution.performance =>
AppLocalizations.of(context).performanceDescription,
RenderResolution.normal => AppLocalizations.of(context).normalDescription,
RenderResolution.normal =>
AppLocalizations.of(context).normalDescription,
RenderResolution.high => AppLocalizations.of(context).highDescription,
};

Expand Down Expand Up @@ -84,9 +87,10 @@ class BehaviorsSettingsPage extends StatelessWidget {
leading: const Icon(PhosphorIconsLight.arrowFatLineUp),
),
ListTile(
title: Text(AppLocalizations.of(context).renderResolution),
subtitle: Text(
_getRenderResolutionName(context, state.renderResolution)),
title:
Text(AppLocalizations.of(context).renderResolution),
subtitle: Text(_getRenderResolutionName(
context, state.renderResolution)),
onTap: () => _openRenderResolutionModal(context),
leading: const Icon(PhosphorIconsLight.sparkle),
),
Expand Down Expand Up @@ -181,7 +185,8 @@ class BehaviorsSettingsPage extends StatelessWidget {

showLeapBottomSheet(
context: context,
titleBuilder: (context) => Text(AppLocalizations.of(context).renderResolution),
titleBuilder: (context) =>
Text(AppLocalizations.of(context).renderResolution),
childrenBuilder: (context) {
void changeResolution(RenderResolution resolution) {
cubit.changeRenderResolution(resolution);
Expand Down
2 changes: 2 additions & 0 deletions metadata/en-US/changelogs/124.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Change create template button to save icon
* Improve thumbnail display to have rounded corners
* Add color wheel to color picker
* Add render resolution to improve moving on canvas
* Improve responsiveness of exact slider
* Change zoom dependent to false by default
* Fix export on web
Expand All @@ -15,6 +16,7 @@
* Fix temporary import handler does not get removed after clicking
* Fix asset hash not correctly working with filenames
* Fix duplicated asset importing
* Fix aspect ratio label in area tool selection view
* Show git hash instead of version in web version
* Upgrade to flutter 3.27

Expand Down

0 comments on commit ec2c9d2

Please sign in to comment.