Compare commits

...

2 Commits

Author SHA1 Message Date
Matthias Clasen
d0021013f9 ngl: Small optimization for shadows
When 9-slicing shadows, omit the center tile when it is
entirely contained in the outline (that is not always
the case, depending on corners and offsets).
2021-04-10 14:02:22 -04:00
Matthias Clasen
12e025f2a0 nodeeditor: Make the help window wide enough
Make the help window wide enough to show the
tables without wrapping.
2021-04-10 11:44:28 -04:00
2 changed files with 15 additions and 9 deletions

View File

@@ -2,8 +2,8 @@
<interface>
<object class="GtkWindow" id="window">
<property name="title" translatable="yes">Help</property>
<property name="default-width">720</property>
<property name="default-height">520</property>
<property name="default-width">920</property>
<property name="default-height">600</property>
<child>
<object class="GtkScrolledWindow">
<child>

View File

@@ -2413,6 +2413,8 @@ gsk_ngl_render_job_visit_blurred_outset_shadow_node (GskNglRenderJob *job,
return;
}
/* slicing */
gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, outset_shadow));
gsk_ngl_program_set_uniform_texture (job->current_program,
UNIFORM_SHARED_SOURCE, 0,
@@ -2555,17 +2557,21 @@ gsk_ngl_render_job_visit_blurred_outset_shadow_node (GskNglRenderJob *job,
/* Middle */
if (nine_slice_is_visible (&slices[NINE_SLICE_CENTER]))
{
memcpy (&offscreen.area, &slices[NINE_SLICE_CENTER].area, sizeof offscreen.area);
float x = min_x + (slices[NINE_SLICE_LEFT_CENTER].rect.width / scale_x);
float y = min_y + (slices[NINE_SLICE_TOP_CENTER].rect.height / scale_y);
float width = (max_x - min_x) - (slices[NINE_SLICE_LEFT_CENTER].rect.width / scale_x +
slices[NINE_SLICE_RIGHT_CENTER].rect.width / scale_x);
float height = (max_y - min_y) - (slices[NINE_SLICE_TOP_CENTER].rect.height / scale_y +
slices[NINE_SLICE_BOTTOM_CENTER].rect.height / scale_y);
gsk_ngl_render_job_draw_offscreen_with_color (job,
&GRAPHENE_RECT_INIT (min_x + (slices[NINE_SLICE_LEFT_CENTER].rect.width / scale_x),
min_y + (slices[NINE_SLICE_TOP_CENTER].rect.height / scale_y),
width, height),
&offscreen,
color);
if (!gsk_rounded_rect_contains_rect (outline, &GRAPHENE_RECT_INIT (x + dx, y + dy, width, height)))
{
memcpy (&offscreen.area, &slices[NINE_SLICE_CENTER].area, sizeof offscreen.area);
gsk_ngl_render_job_draw_offscreen_with_color (job,
&GRAPHENE_RECT_INIT (x, y, width, height),
&offscreen,
color);
}
}
}