gl renderer: Fix repeat nodes that don't repeat

Fixes #2234
This commit is contained in:
Timm Bäder
2019-11-19 10:31:21 +01:00
parent 581f5bd749
commit 604f44da11
2 changed files with 4 additions and 4 deletions

View File

@@ -1973,8 +1973,8 @@ render_repeat_node (GskGLRenderer *self,
ops_set_texture (builder, region.texture_id);
op = ops_begin (builder, OP_CHANGE_REPEAT);
op->child_bounds[0] = 0; /* Both currently unused */
op->child_bounds[1] = 0;
op->child_bounds[0] = (node->bounds.origin.x - child_bounds->origin.x) / child_bounds->size.width;
op->child_bounds[1] = (node->bounds.origin.y - child_bounds->origin.y) / child_bounds->size.height;
op->child_bounds[2] = node->bounds.size.width / child_bounds->size.width;
op->child_bounds[3] = node->bounds.size.height / child_bounds->size.height;

View File

@@ -21,8 +21,8 @@ void main() {
float mapped_x = (vUv.x - u_texture_rect.x) / tw;
float mapped_y = (vUv.y - u_texture_rect.y) / th;
float wrapped_x = wrap(mapped_x * u_child_bounds.z, 1.0);
float wrapped_y = wrap(mapped_y * u_child_bounds.w, 1.0);
float wrapped_x = u_child_bounds.x + wrap(mapped_x * u_child_bounds.z, 1.0);
float wrapped_y = u_child_bounds.y + wrap(mapped_y * u_child_bounds.w, 1.0);
vec2 tp;
tp.x = u_texture_rect.x + (wrapped_x * tw);