When starting a game from the command line for a target that had
not previously been added, a temporary target is created. When
subsequently returning to the launcher, it would attempt to
include that temporary target in list of games (and crash when
trying to get the path with an unknown key error as those
temporary targets do not have a path value set, which is actually
how I noticed the issue).
The same rect was hardcoded in three different places. Now it is
only in getEditRect and the other places use getEditRect.
There were actually differences between the rect width, but I put
that down to a bug in getEditRect. I see no reason to define the
right position of the rect as w - 2 - right_padding - left_padding.
Substracting the left padding would make sense if we were
specifying the rect width, but the Common:Rect constructor takes
the rect right location and not the width. There might have been
a confusion on that point by the developer who wrote that code
years ago. Also has the bottom right point is excluded, we should
only remove 1 and not 2.
This width that was smaller than it should be might have been the
reason why 6 additional pixels were arbitrarily added to the rect
passed to setTextDrawableArea later on.
There were actually
There was a discrepency in the vertical position of the text in
the drawText call on one hand, and in the getEditRect() and rect
passed to setTextDrawableArea() on the other. This discrepency
was introduced in commit c47b204ac. Since getEditRect() is used
in EditableWidget::drawCaret() to draw the character after the
caret (when erasing the caret) this caused this vertical shift.
This fixes bug #12336.
We know the resolution and we do reread everything on the resolution
change anyway. This simplifies everything: we just draw transparent
surfaces everywhere, regardless of their source format.