From ef6847b12c1ce3692650b79a69141d24d51c1a2b Mon Sep 17 00:00:00 2001 From: "Pedro M. de Echanove Pasquin" Date: Sat, 17 Oct 2026 20:04:40 +0200 Subject: [PATCH] =?UTF-8?q?Rectangles=20with=20square=20corners=20are=20fi?= =?UTF-8?q?lled=20with=20hard=20edges=20on=20the=20GLES=20backend,=20so=20?= =?UTF-8?q?rectangles=20that=20share=20an=20edge=20leave=20no=20seam=20bet?= =?UTF-8?q?ween=20them=20On=20the=20GLES=20backend,=20Prompt's=20selection?= =?UTF-8?q?=20showed=20a=20dark=20line=20between=20every=20two=20of=20its?= =?UTF-8?q?=20rows.=20`GlesCanvas::fill=5Frect`=20always=20grew=20the=20qu?= =?UTF-8?q?ad=20by=201=20px=20and=20passed=20`u=5Fpad=20=3D=201`,=20so=20t?= =?UTF-8?q?he=20rect=20shader=20never=20took=20its=20solid=20path,=20which?= =?UTF-8?q?=20only=20runs=20with=20no=20radius,=20no=20stroke=20and=20no?= =?UTF-8?q?=20pad,=20and=20antialiased=20every=20rectangle=20over=20a=20ba?= =?UTF-8?q?nd=20from=20=E2=88=921=20to=20+1=20px=20around=20its=20edge.=20?= =?UTF-8?q?A=20pixel=20along=20an=20edge,=20its=20centre=20half=20a=20pixe?= =?UTF-8?q?l=20inside,=20was=20covered=20at=2084=20%=20even=20when=20the?= =?UTF-8?q?=20edge=20lay=20on=20a=20whole=20pixel,=20so=20two=20rectangles?= =?UTF-8?q?=20that=20met=20there=20each=20left=2016=20%=20of=20what=20lay?= =?UTF-8?q?=20beneath=20showing=20through,=20which=20over=20a=20dark=20bac?= =?UTF-8?q?kground=20reads=20as=20a=20line.=20The=20software=20backend=20d?= =?UTF-8?q?oes=20not=20show=20it,=20since=20tiny-skia=20covers=20a=20pixel?= =?UTF-8?q?-aligned=20edge=20fully.=20A=20rectangle=20with=20square=20corn?= =?UTF-8?q?ers=20now=20gets=20no=20pad,=20which=20takes=20the=20shader's?= =?UTF-8?q?=20hard-edged=20path,=20as=20tiny-skia=20fills=20it.=20Rounded?= =?UTF-8?q?=20rectangles=20keep=20the=20pad=20and=20their=20antialiased=20?= =?UTF-8?q?edges.=20A=20square=20rectangle=20whose=20edges=20fall=20betwee?= =?UTF-8?q?n=20pixels=20now=20has=20a=20hard=20edge=20where=20it=20had=20a?= =?UTF-8?q?=20soft=20one.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gles_render/primitives.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gles_render/primitives.rs b/src/gles_render/primitives.rs index 1f74ae8..343c022 100644 --- a/src/gles_render/primitives.rs +++ b/src/gles_render/primitives.rs @@ -132,7 +132,8 @@ impl GlesCanvas // straight edges of pills / rounded rects. `u_size` and `u_radii` // stay anchored to the original rect — `u_pad` lets the shader // remap `v_uv` from the larger quad back into rect-local space. - let pad = 1.0_f32; + // Square corners take the shader's hard-edged path instead, so rects that share an edge leave no seam. + let pad = if corners.is_zero() { 0.0_f32 } else { 1.0 }; let expanded = rect.expand( pad ); let mvp = ortho_rect( self.width, self.height, expanded ); let alpha = color.a * self.global_alpha;