Keyboard max size didn't account for UI buttons
Keyboard's goal is to not be > 90% of the width of the drawing
canvas. Was misinterpreting the incoming argument ('canvas'),
so have to account for the toolbar (left) and selector (right)
buttons in the UI.
So e.g., `tuxpaint --900x768 --onscreen-keyboard` will use the
small keyboard buttons, while `... --1024x768 ...` will use the large.
This commit is contained in:
parent
61998e4d00
commit
8ef759a9a7
1 changed files with 1 additions and 1 deletions
|
|
@ -127,7 +127,7 @@ struct osk_keyboard *osk_create(char * layout_name, SDL_Surface * canvas,
|
|||
printf("w %i, h %i\n", layout->width, layout->height);
|
||||
#endif
|
||||
|
||||
if (layout->width * LG_button_up->w >= canvas->w * 0.9 ||
|
||||
if (layout->width * LG_button_up->w >= (canvas->w - 48 * 4) * 0.9 ||
|
||||
layout->height * LG_button_up->h >= canvas->h * 0.5) {
|
||||
/* Full-size buttons too large, use small buttons */
|
||||
button_up = SM_button_up;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue