Re: Decreasing seams in scaled windows

John Ehresman <[email protected]> Fri, 3 Jul 2026 19:37:23 -0400
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
--Apple-Mail=_F8087CD0-D246-49AE-AC23-671FA367FDEF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

I=E2=80=99ve been using the pixel scale technique and it seems to work well=
 enough. I did see that the + and - markers for folding have a 2 device pix=
el interior width. Attached patch changes this to 2*strokeWidth which seems=
 reasonable, though it is a change under the default scaling technique; ano=
ther sizing parameter also could be added or this could only affect pixel s=
caling technique rendering.

Thanks,

John

--=20
You received this message because you are subscribed to the Google Groups "=
scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-i=
nterest/A6F1FA20-697A-4363-8928-35F136FEC8E2%40wingware.com.

--Apple-Mail=_F8087CD0-D246-49AE-AC23-671FA367FDEF
Content-Disposition: attachment;
	filename=marker-scale.diff
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="marker-scale.diff"
Content-Transfer-Encoding: 7bit

diff -r f38b65e330de -r 322dfe69f758 src/LineMarker.cxx
--- a/src/LineMarker.cxx	Fri Jul 03 17:01:40 2026 -0400
+++ b/src/LineMarker.cxx	Fri Jul 03 18:51:13 2026 -0400
@@ -371,7 +371,11 @@
 	const XYPOSITION centreY = std::floor(centre.y);
 	const XYPOSITION dimOn2 = std::floor(minDim / 2);
 	const XYPOSITION dimOn4 = std::floor(minDim / 4);
-	const XYPOSITION armSize = dimOn2 - 2;
+	// Half-thickness of the plus/minus bars, historically 1 pixel.  Scale
+	// with strokeWidth so the symbols keep their weight when the surface
+	// is in device pixels and strokeWidth has been set to match.
+	const XYPOSITION barOn2 = std::round(std::max<XYPOSITION>(strokeWidth, 1.0));
+	const XYPOSITION armSize = dimOn2 - 2 * barOn2;
 	if (marginStyle == MarginType::Number || marginStyle == MarginType::Text || marginStyle == MarginType::RText) {
 		// On textual margins move marker to the left to try to avoid overlapping the text
 		centreX = rcWhole.left + dimOn2 + 1;
@@ -418,18 +422,18 @@
 
 	case MarkerSymbol::Plus: {
 			const Point pts[] = {
-				Point(centreX - armSize, centreY - 1),
-				Point(centreX - 1, centreY - 1),
-				Point(centreX - 1, centreY - armSize),
-				Point(centreX + 1, centreY - armSize),
-				Point(centreX + 1, centreY - 1),
-				Point(centreX + armSize, centreY - 1),
-				Point(centreX + armSize, centreY + 1),
-				Point(centreX + 1, centreY + 1),
-				Point(centreX + 1, centreY + armSize),
-				Point(centreX - 1, centreY + armSize),
-				Point(centreX - 1, centreY + 1),
-				Point(centreX - armSize, centreY + 1),
+				Point(centreX - armSize, centreY - barOn2),
+				Point(centreX - barOn2, centreY - barOn2),
+				Point(centreX - barOn2, centreY - armSize),
+				Point(centreX + barOn2, centreY - armSize),
+				Point(centreX + barOn2, centreY - barOn2),
+				Point(centreX + armSize, centreY - barOn2),
+				Point(centreX + armSize, centreY + barOn2),
+				Point(centreX + barOn2, centreY + barOn2),
+				Point(centreX + barOn2, centreY + armSize),
+				Point(centreX - barOn2, centreY + armSize),
+				Point(centreX - barOn2, centreY + barOn2),
+				Point(centreX - armSize, centreY + barOn2),
 			};
 			AlignedPolygon(surface, pts, std::size(pts));
 		}
@@ -437,10 +441,10 @@
 
 	case MarkerSymbol::Minus: {
 			const Point pts[] = {
-				Point(centreX - armSize, centreY - 1),
-				Point(centreX + armSize, centreY - 1),
-				Point(centreX + armSize, centreY + 1),
-				Point(centreX - armSize, centreY + 1),
+				Point(centreX - armSize, centreY - barOn2),
+				Point(centreX + armSize, centreY - barOn2),
+				Point(centreX + armSize, centreY + barOn2),
+				Point(centreX - armSize, centreY + barOn2),
 			};
 			AlignedPolygon(surface, pts, std::size(pts));
 		}


--Apple-Mail=_F8087CD0-D246-49AE-AC23-671FA367FDEF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"



> On Jun 29, 2026, at 2:24=E2=80=AFAM, Neil Hodgson <scintilladotorg@gmail.=
com> wrote:
>=20
> John:
>=20
>> I=E2=80=99m attaching my 2nd try at a patch ...
>=20
> Committed.
>=20
> Neil
>=20
> --=20
> You received this message because you are subscribed to the Google Groups=
 "scintilla-interest" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
 email to [email protected].
> To view this discussion visit https://groups.google.com/d/msgid/scintilla=
-interest/CACWkrThB30%3DRe1wD52%3D-awz0syx-HeuW7_T_UjUVRS_ZmunO6Q%40mail.gm=
ail.com.

--=20
You received this message because you are subscribed to the Google Groups "=
scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-i=
nterest/A6F1FA20-697A-4363-8928-35F136FEC8E2%40wingware.com.

--Apple-Mail=_F8087CD0-D246-49AE-AC23-671FA367FDEF--