Skip to content

Commit

Permalink
Properly round the opacity percentages to an integer.
Browse files Browse the repository at this point in the history
If the percentage ended up being a value like 57.99999... , this was being truncated to 57 instead of rounding to 58

Fixes: 2020596
  • Loading branch information
cameronwhite committed May 24, 2023
1 parent 4ffcb74 commit 73b8f1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Thanks to the following contributors who worked on this release:
### Fixed
- Fixed an issue where the Pan tool's cursor could show up as a missing icon ([#2013047](https://bugs.launchpad.net/pinta/+bug/2013047))
- Fixed errors when saving a file that was opened with a missing or incorrect extension ([#2013050](https://bugs.launchpad.net/pinta/+bug/2013050))
- Fixed a bug where certain layer opacity settings could be incorrectly rounded ([#2020596](https://bugs.launchpad.net/pinta/+bug/2020596))

## [2.1.1](https://github.com/PintaProject/Pinta/releases/tag/2.1.1) - 2023/02/26

Expand Down
4 changes: 2 additions & 2 deletions Pinta/Dialogs/LayerPropertiesDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public LayerPropertiesDialog ()

layerNameEntry.SetText (initial_properties.Name);
visibilityCheckbox.Active = !initial_properties.Hidden;
opacitySpinner.Value = (int) (initial_properties.Opacity * 100);
opacitySlider.SetValue ((int) (initial_properties.Opacity * 100));
opacitySpinner.Value = Math.Round (initial_properties.Opacity * 100);
opacitySlider.SetValue (Math.Round (initial_properties.Opacity * 100));

var all_blendmodes = UserBlendOps.GetAllBlendModeNames ().ToList ();
var index = all_blendmodes.IndexOf (UserBlendOps.GetBlendModeName (blendmode));
Expand Down

0 comments on commit 73b8f1f

Please sign in to comment.