diff --git a/source/blender/gpu/shaders/gpu_shader_sequencer_strips_frag.glsl b/source/blender/gpu/shaders/gpu_shader_sequencer_strips_frag.glsl index 89ea3f907f7..7ed02cd5aa9 100644 --- a/source/blender/gpu/shaders/gpu_shader_sequencer_strips_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_sequencer_strips_frag.glsl @@ -44,11 +44,13 @@ void main() vec2 center = vec2(strip.right_handle + strip.left_handle, strip.top + strip.bottom) * 0.5; /* Transform strip rectangle into pixel coordinates, so that - * rounded corners have proper aspect ratio and can be expressed in pixels. */ + * rounded corners have proper aspect ratio and can be expressed in pixels. + * Also snap to pixel grid coorinates, so that outline/border is clear + * non-fractional pixel sizes. */ vec2 view_to_pixel = vec2(context_data.inv_pixelx, context_data.inv_pixely); - size *= view_to_pixel; - center *= view_to_pixel; - vec2 pos = co * view_to_pixel; + size = round(size * view_to_pixel); + center = round(center * view_to_pixel); + vec2 pos = round(co * view_to_pixel); float radius = context_data.round_radius; if (radius > size.x) { diff --git a/source/blender/gpu/shaders/gpu_shader_sequencer_strips_vert.glsl b/source/blender/gpu/shaders/gpu_shader_sequencer_strips_vert.glsl index 767e17808df..ba93f1ce11e 100644 --- a/source/blender/gpu/shaders/gpu_shader_sequencer_strips_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_sequencer_strips_vert.glsl @@ -9,11 +9,10 @@ void main() int vid = gl_VertexID; SeqStripDrawData strip = strip_data[id]; vec4 rect = vec4(strip.left_handle, strip.bottom, strip.right_handle, strip.top); - /* Expand rasterized rectangle by 1px so that we can do outlines. */ - rect.x -= context_data.pixelx; - rect.z += context_data.pixelx; - rect.y -= context_data.pixely; - rect.w += context_data.pixely; + /* Expand by 2px to fit possible outline and pixel grid rounding. */ + vec2 expand = vec2(context_data.pixelx, context_data.pixely) * 2.0; + rect.xy -= expand; + rect.zw += expand; vec2 co; if (vid == 0) {