Merge pull request #13214 from MrHuu/ctr_achievement_widget_fix

[3DS] Fix achievement widget
This commit is contained in:
Autechre 2021-11-09 20:18:30 +01:00 committed by GitHub
commit 89002e6b72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 45 deletions

View File

@ -464,40 +464,43 @@ void gfx_display_scissor_begin(
int x, int y, unsigned width, unsigned height) int x, int y, unsigned width, unsigned height)
{ {
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx; gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
if (y < 0) if (dispctx && dispctx->scissor_begin)
{ {
if (height < (unsigned)(-y)) if (y < 0)
height = 0; {
else if (height < (unsigned)(-y))
height += y; height = 0;
y = 0; else
} height += y;
if (x < 0) y = 0;
{ }
if (width < (unsigned)(-x)) if (x < 0)
width = 0; {
else if (width < (unsigned)(-x))
width += x; width = 0;
x = 0; else
} width += x;
if (y >= (int)video_height) x = 0;
{ }
height = 0; if (y >= (int)video_height)
y = 0; {
} height = 0;
if (x >= (int)video_width) y = 0;
{ }
width = 0; if (x >= (int)video_width)
x = 0; {
} width = 0;
if ((y + height) > video_height) x = 0;
height = video_height - y; }
if ((x + width) > video_width) if ((y + height) > video_height)
width = video_width - x; height = video_height - y;
if ((x + width) > video_width)
width = video_width - x;
dispctx->scissor_begin(userdata, dispctx->scissor_begin(userdata,
video_width, video_height, video_width, video_height,
x, y, width, height); x, y, width, height);
}
} }
font_data_t *gfx_display_font_file( font_data_t *gfx_display_font_file(

View File

@ -1262,11 +1262,10 @@ static void gfx_widgets_draw_task_msg(
gfx_widgets_flush_text(video_width, video_height, gfx_widgets_flush_text(video_width, video_height,
&p_dispwidget->gfx_widget_fonts.msg_queue); &p_dispwidget->gfx_widget_fonts.msg_queue);
if (p_disp->dispctx && p_disp->dispctx->scissor_begin) gfx_display_scissor_begin(p_disp,
gfx_display_scissor_begin(p_disp, userdata,
userdata, video_width, video_height,
video_width, video_height, rect_x, rect_y, rect_width, rect_height);
rect_x, rect_y, rect_width, rect_height);
gfx_widgets_draw_text(&p_dispwidget->gfx_widget_fonts.msg_queue, gfx_widgets_draw_text(&p_dispwidget->gfx_widget_fonts.msg_queue,
msg->msg_new, msg->msg_new,
@ -1348,14 +1347,14 @@ static void gfx_widgets_draw_regular_msg(
gfx_widgets_flush_text(video_width, video_height, gfx_widgets_flush_text(video_width, video_height,
&p_dispwidget->gfx_widget_fonts.msg_queue); &p_dispwidget->gfx_widget_fonts.msg_queue);
if (p_disp->dispctx && p_disp->dispctx->scissor_begin)
gfx_display_scissor_begin(p_disp, gfx_display_scissor_begin(p_disp,
userdata, userdata,
video_width, video_height, video_width, video_height,
p_dispwidget->msg_queue_scissor_start_x, 0, p_dispwidget->msg_queue_scissor_start_x, 0,
(p_dispwidget->msg_queue_scissor_start_x + msg->width - (p_dispwidget->msg_queue_scissor_start_x + msg->width -
p_dispwidget->simple_widget_padding * 2) p_dispwidget->simple_widget_padding * 2)
* msg->unfold, video_height); * msg->unfold, video_height);
} }
/* Background */ /* Background */