-
Notifications
You must be signed in to change notification settings - Fork 298
Open
Description
I was following this example, but I always encounter an error about invalid scissor. I just found out the problem was the rect was overflowing the surface bound. I guess the example need to be updated so no one will stumble upon my same exact problem.
more or less, it can be rewritten into
conrod_wgpu::RenderPassCommand::SetScissor {
top_left: [x, y],
dimensions: [w, h],
} => {
render_pass.set_scissor_rect(x, y, w, h);
}
It should be clamped to the surface size
conrod_wgpu::RenderPassCommand::SetScissor {
top_left: [x, y],
dimensions: [mut w, mut h],
} => {
if w + x > surface_config.surface.width { // Surface width
w = surface_config.surface.width - x;
}
if h + y > surface_config.surface.height { // Surface height
h = surface_config.surface.height - y;
}
render_pass.set_scissor_rect(x, y, w, h);
}
Metadata
Metadata
Assignees
Labels
No labels