summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/labelwidget.c14
-rw-r--r--src/ui/paint.c8
2 files changed, 18 insertions, 4 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c
index a9a2d033..d6cc31cb 100644
--- a/src/ui/labelwidget.c
+++ b/src/ui/labelwidget.c
@@ -30,6 +30,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
30#include "keys.h" 30#include "keys.h"
31#include "touch.h" 31#include "touch.h"
32 32
33#include <SDL_version.h>
34
33struct Impl_LabelWidget { 35struct Impl_LabelWidget {
34 iWidget widget; 36 iWidget widget;
35 iString srcLabel; 37 iString srcLabel;
@@ -295,8 +297,16 @@ static void draw_LabelWidget_(const iLabelWidget *d) {
295 iRect frameRect = adjusted_Rect(rect, zero_I2(), init1_I2(-1)); 297 iRect frameRect = adjusted_Rect(rect, zero_I2(), init1_I2(-1));
296 if (isButton) { 298 if (isButton) {
297 iInt2 points[] = { 299 iInt2 points[] = {
298 bottomLeft_Rect(frameRect), topLeft_Rect(frameRect), topRight_Rect(frameRect), 300 bottomLeft_Rect(frameRect),
299 bottomRight_Rect(frameRect), bottomLeft_Rect(frameRect) 301 topLeft_Rect(frameRect),
302 topRight_Rect(frameRect),
303#if SDL_VERSION_ATLEAST(2, 0, 16) && defined (iPlatformApple)
304 /* A very curious regression in SDL 2.0.16 on macOS. */
305 addX_I2(bottomRight_Rect(frameRect), -1),
306#else
307 bottomRight_Rect(frameRect),
308#endif
309 bottomLeft_Rect(frameRect)
300 }; 310 };
301 drawLines_Paint(&p, points + 2, 3, frame2); 311 drawLines_Paint(&p, points + 2, 3, frame2);
302 drawLines_Paint( 312 drawLines_Paint(
diff --git a/src/ui/paint.c b/src/ui/paint.c
index c575d5fc..869238d5 100644
--- a/src/ui/paint.c
+++ b/src/ui/paint.c
@@ -91,9 +91,13 @@ void drawRect_Paint(const iPaint *d, iRect rect, int color) {
91 if (br.y == d->dst->size.y) br.y--; 91 if (br.y == d->dst->size.y) br.y--;
92 const SDL_Point edges[] = { 92 const SDL_Point edges[] = {
93 { left_Rect(rect), top_Rect(rect) }, 93 { left_Rect(rect), top_Rect(rect) },
94 { br.x, top_Rect(rect) }, 94 { br.x, top_Rect(rect) },
95 { br.x, br.y }, 95 { br.x, br.y },
96#if SDL_VERSION_ATLEAST(2, 0, 16) && defined (iPlatformApple)
97 { left_Rect(rect), br.y - 1 }, /* regression in SDL 2.0.16? */
98#else
96 { left_Rect(rect), br.y }, 99 { left_Rect(rect), br.y },
100#endif
97 { left_Rect(rect), top_Rect(rect) } 101 { left_Rect(rect), top_Rect(rect) }
98 }; 102 };
99 setColor_Paint_(d, color); 103 setColor_Paint_(d, color);