thumbnail2() - ceil() the new_x & new_y calculations

I noticed that buttonsize=90 or =91 would end up with UI buttons
images ere one pixel smaller (89x89 or 90x90, respectively) than
expected, hence they layout would end up with one row and one
column of unused pixels between them.  Any button content (e.g.
stamp thumbnails) that might render into the full size would end
up leaving garbage pixels behind.

Applying ceil() to the new_x and new_y (but then making sure they do
not exceed the requested max_x and max_y) calculated sizes inside the
thumbnail2() function.  (We do not simply use max_x and max_y directly,
because we are usually trying to maintain the original image's aspect
ratio.)
This commit is contained in:
Bill Kendrick 2023-05-04 23:29:39 -07:00
parent aa2235c8ba
commit 3f5bc2b554
2 changed files with 17 additions and 5 deletions

View file

@ -142,6 +142,10 @@ https://tuxpaint.org/
seeing no stamps between the up/down scroll buttons!)
Bill Kendrick <bill@newbreedsoftware.com>
* Some button sizes could cause buttons to render with gaps
(e.g. 90 and 91), where 'garbage' graphics could appear.
Bill Kendrick <bill@newbreedsoftware.com>
* Ports & Building:
-----------------
* Created "src/indent.sh", to run 'indent' against source files.