Fix: also save default_units_short when units toggled in dialogs

Keeps the info-bar unit symbol (px, ", cm, mm) in sync when the user
switches units via the in-dialog toggle rather than Tools > Settings.

https://claude.ai/code/session_017wupXfpjuoSdAqVyak4fJf
This commit is contained in:
Claude
2026-06-12 02:13:34 +00:00
parent f28d8e44b6
commit 0cf10398bc
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -97,7 +97,9 @@ class Image_resize_class {
var resolution = this.Tools_settings.get_setting('resolution');
// Persist so Canvas Size and other dialogs open with the same units
const unitShort = {pixels: 'px', inches: '"', centimeters: 'cm', millimetres: 'mm'};
this.Tools_settings.save_setting('default_units', units);
this.Tools_settings.save_setting('default_units_short', unitShort[units] || units);
var newWidth = this.Helper.get_user_unit(config.WIDTH, units, resolution);
var newHeight = this.Helper.get_user_unit(config.HEIGHT, units, resolution);
+2
View File
@@ -83,7 +83,9 @@ class Image_size_class {
var resolution = this.Tools_settings.get_setting('resolution');
// Persist so Resize and other dialogs open with the same units
const unitShort = {pixels: 'px', inches: '"', centimeters: 'cm', millimetres: 'mm'};
this.Tools_settings.save_setting('default_units', units);
this.Tools_settings.save_setting('default_units_short', unitShort[units] || units);
var newWidth = this.Helper.get_user_unit(config.WIDTH, units, resolution);
var newHeight = this.Helper.get_user_unit(config.HEIGHT, units, resolution);