Skip to content

Conversation

@flimsyhat
Copy link
Contributor

Corrects issue where zoom percentages were being stored as a multiplier, meaning the image size was shrinking with each export

Exporting image with options copy

The bug was occurring because:
The UI showed zoom as a percentage (e.g., "100%")
The internal state converted this to a decimal (100%/100 → 1.0) for export
This decimal (1.0) was incorrectly saved back to the settings (1%)
On subsequent exports, this value was divided by 100 again (1%/100 → 0.01), resulting in increasingly small images

This has been fixed by converting back to a percentage before saving the zoom value

flimsyhat and others added 5 commits April 1, 2025 11:47
corrects issue where zoom percentages were being stored as a multiplier, meaning the image size was shrinking with each export
- the `self.image["zoom"]` state field now uses 1.0 as 100%
- the `self.imageZoom` outlet uses "100" as 100%
- when exiting the modal, the zoom value is now persisted correctly (rather than accidentally being divided by 100)
@samizdatco
Copy link
Member

Thanks so much for diagnosing this so thoroughly! I think I've found a slightly more minimal fix by keeping the internal state in floating point (where 100%==1.0) and only translating to/from integer form when updating the text field.

@samizdatco samizdatco merged commit e090362 into plotdevice:main May 23, 2025
1 check passed
@flimsyhat
Copy link
Contributor Author

Your fix is much more straightforward, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants