[LyX/master] Slightly increase size of math decorations

Enrico Forestieri forenr at lyx.org
Fri Feb 12 22:15:48 UTC 2021


commit 2ba8ebab672f8b168f128b73f4c6022af40ff385
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Fri Feb 12 23:16:03 2021 +0100

    Slightly increase size of math decorations
    
    Correspondingly tweak some shapes for better results.
    
    Part of #12132.
---
 src/mathed/InsetMathDecoration.cpp |    4 +-
 src/mathed/MathSupport.cpp         |   90 ++++++++++++++++++------------------
 2 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp
index 8bd0047..ae95cdc 100644
--- a/src/mathed/InsetMathDecoration.cpp
+++ b/src/mathed/InsetMathDecoration.cpp
@@ -122,8 +122,8 @@ void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const
 	cell(0).metrics(mi, dim);
 
 	int const l1 = mi.base.bv->zoomedPixels(1);
-	int const l2 = 2 * l1;
-	int const l3 = 3 * l1;
+	int const l2 = 4 * l1;
+	int const l3 = 4 * l1;
 
 	dh_  = l2; //mathed_char_height(LM_TC_VAR, mi, 'I', ascent_, descent_);
 	dw_  = l3; //mathed_char_width(LM_TC_VAR, mi, 'x');
diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp
index ee3f6b1..1203a31 100644
--- a/src/mathed/MathSupport.cpp
+++ b/src/mathed/MathSupport.cpp
@@ -103,9 +103,17 @@ double const parenth[] = {
 	2, 13,
 	0.9930, 0.0071, 0.7324, 0.0578, 0.5141, 0.1126,
 	0.3380, 0.1714, 0.2183, 0.2333, 0.0634, 0.3621,
-	0.0141, 0.5000, 0.0563, 0.6369, 0.2113, 0.7647,
-	0.3310, 0.8276, 0.5070, 0.8864, 0.7254, 0.9412,
-	0.9930, 0.9919,
+	0.0141, 0.5000, 0.0634, 0.6379, 0.2183, 0.7667,
+	0.3380, 0.8286, 0.5141, 0.8874, 0.7324, 0.9422,
+	0.9930, 0.9929,
+	0
+};
+
+
+double const breve[] = {
+	2, 8,
+	0.100, 0.400,  0.125, 0.550,  0.200, 0.700,  0.400, 0.800,
+	0.600, 0.800,  0.800, 0.700,  0.875, 0.550,  0.900, 0.400,
 	0
 };
 
@@ -212,9 +220,19 @@ double const rlharpoons[] = {
 };
 
 
+double const vec[] = {
+	4, 7,
+	0.2000, 0.5000, 0.3000, 0.4000, 0.4000, 0.2500,
+	0.5000, 0.0000, 0.6000, 0.2500, 0.7000, 0.4000,
+	0.8000, 0.5000,
+	3, 0.5000, 0.1000, 0.5000, 0.9500,
+	0
+};
+
+
 double const arrow[] = {
 	4, 7,
-	0.0150, 0.7500, 0.2000, 0.6000, 0.3500, 0.3500,
+	0.0500, 0.7500, 0.2000, 0.6000, 0.3500, 0.3500,
 	0.5000, 0.0500, 0.6500, 0.3500, 0.8000, 0.6000,
 	0.9500, 0.7500,
 	3, 0.5000, 0.1500, 0.5000, 0.9500,
@@ -279,7 +297,7 @@ double const corner[] = {
 
 double const angle[] = {
 	2, 3,
-	1, 0,  0.05, 0.5,  1, 1,
+	0.9, 0.05,  0.05, 0.5,  0.9, 0.95,
 	0
 };
 
@@ -313,18 +331,18 @@ double const ddot[] = {
 
 
 double const dddot[] = {
-	5, -0.2, 0.5, 0.0, 0.5,
-	5,  0.3, 0.5, 0.5, 0.5,
-	5,  0.8, 0.5, 1.0, 0.5,
+	5, 0.0, 0.5, 0.2, 0.5,
+	5, 0.4, 0.5, 0.6, 0.5,
+	5, 0.8, 0.5, 1.0, 0.5,
 	0
 };
 
 
 double const ddddot[] = {
-	5, -0.4, 0.5, -0.2, 0.5,
-	5,  0.1, 0.5,  0.3, 0.5,
-	5,  0.6, 0.5,  0.8, 0.5,
-	5,  1.1, 0.5,  1.3, 0.5,
+	5, -0.2, 0.5, 0.0, 0.5,
+	5,  0.2, 0.5, 0.4, 0.5,
+	5,  0.6, 0.5, 0.8, 0.5,
+	5,  1.0, 0.5, 1.2, 0.5,
 	0
 };
 
@@ -346,10 +364,11 @@ double const dline3[] = {
 
 
 double const ring[] = {
-	2, 9,
-	0.5, 0.8,  0.7, 0.7,  0.8, 0.4,
-	0.7, 0.1,  0.5, 0.0,  0.3, 0.1,
-	0.2, 0.4,  0.3, 0.7,  0.5, 0.8,
+	2, 13,
+	0.5000, 0.7750,  0.6375, 0.7375,  0.7375, 0.6375,  0.7750, 0.5000,
+	0.7375, 0.3625,  0.6375, 0.2625,  0.5000, 0.2250,  0.3625, 0.2625,
+	0.2625, 0.3625,  0.2250, 0.5000,  0.2625, 0.6375,  0.3625, 0.7375,
+	0.5000, 0.7750,
 	0
 };
 
@@ -368,8 +387,9 @@ double const  Vert[] = {
 
 
 double const tilde[] = {
-	2, 6,
-	0.0, 0.8,  0.15, 0.2,  0.35, 0.2,  0.65, 0.8,  0.85, 0.8,  1.0, 0.2,
+	2, 10,
+	0.000, 0.625, 0.050, 0.500, 0.150, 0.350, 0.275, 0.275, 0.400, 0.350,
+	0.575, 0.650, 0.700, 0.725, 0.825, 0.650, 0.925, 0.500, 0.975, 0.375,
 	0
 };
 
@@ -467,8 +487,8 @@ named_deco_struct deco_table[] = {
 	{"bar",            hline,      0 },
 	{"dot",            dot,        0 },
 	{"check",          angle,      1 },
-	{"breve",          parenth,    1 },
-	{"vec",            arrow,      3 },
+	{"breve",          breve,      0 },
+	{"vec",            vec,        3 },
 	{"mathring",       ring,       0 },
 
 	// Dots
@@ -667,33 +687,13 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
 				             int(xb - 1), int(yb + 1),
 				             pi.base.font.color(),
 				             Painter::line_solid, lw);
-				if (xa + 2 <= xb - 2) {
-					pi.pain.line(int(xa + 2), int(ya - 2),
-						     int(xb - 2), int(yb - 2),
-						     pi.base.font.color(),
-						     Painter::line_solid, lw);
-					pi.pain.line(int(xa + 2), int(ya + 2),
-						     int(xb - 2), int(yb + 2),
-						     pi.base.font.color(),
-						     Painter::line_solid, lw);
-				}
-				if (xa + 3 <= xb - 3) {
-					pi.pain.line(int(xa + 3), int(ya - 3),
-						     int(xb - 3), int(yb - 3),
-						     pi.base.font.color(),
-						     Painter::line_solid, lw);
-					pi.pain.line(int(xa + 3), int(ya + 3),
-						     int(xb - 3), int(yb + 3),
-						     pi.base.font.color(),
-						     Painter::line_solid, lw);
-				}
-				if (xa + 4 <= xb - 4) {
-					pi.pain.line(int(xa + 4), int(ya - 4),
-						     int(xb - 4), int(yb - 4),
+				for (int k = 2; xa + k <= xb - k; k++) {
+					pi.pain.line(int(xa + k), int(ya - k),
+						     int(xb - k), int(yb - k),
 						     pi.base.font.color(),
 						     Painter::line_solid, lw);
-					pi.pain.line(int(xa + 4), int(ya + 4),
-						     int(xb - 4), int(yb + 4),
+					pi.pain.line(int(xa + k), int(ya + k),
+						     int(xb - k), int(yb + k),
 						     pi.base.font.color(),
 						     Painter::line_solid, lw);
 				}


More information about the lyx-cvs mailing list