summaryrefslogtreecommitdiff
diff options
authorAntonin Houska <[email protected]>2025-10-20 09:07:12 +0200
committerAntonin Houska <[email protected]>2025-10-20 09:07:12 +0200
commitc7929489130c8de9ceb703eeeb9e76849f61ebc5 (patch)
tree6fef7f3a65ab3fb1341aed6c8bc50ed1aacb599c
parent2c89a71a1d129f9b5c143ae173689b1362d6ae06 (diff)
downloadmetapostgres-master.tar.gz
Fixed thinko in drawing labels: first filling then text.HEADmaster
-rw-r--r--common.mp16
1 files changed, 8 insertions, 8 deletions
diff --git a/common.mp b/common.mp
index 1668733..6f03d10 100644
--- a/common.mp
+++ b/common.mp
@@ -154,14 +154,6 @@ def drawlabel(text i) =
% TODO Introduce a separate pen for labels.
pickup arrowpen;
- draw label[i] shifted (
- % First, find the middle point of the lower edge ...
- (label[i].ll + label[i].lr) / 2 -
- % ... then shift the lower left corner of the letter horizontally ...
- (lrcorner label[i] - llcorner label[i]) / 2 +
- % ... and move the text upwards vertically.
- (0, labelbordery + labeldpth));
-
if not label[i].textonly:
% Fill the area.
fill label[i].ll--label[i].lr--label[i].ur--label[i].ul--cycle withcolor labelbgcolor;
@@ -171,6 +163,14 @@ def drawlabel(text i) =
% Draw the bounding box.
draw label[i].ll--label[i].ul--label[i].ur--label[i].lr--cycle;
fi;
+
+ draw label[i] shifted (
+ % First, find the middle point of the lower edge ...
+ (label[i].ll + label[i].lr) / 2 -
+ % ... then shift the lower left corner of the letter horizontally ...
+ (lrcorner label[i] - llcorner label[i]) / 2 +
+ % ... and move the text upwards vertically.
+ (0, labelbordery + labeldpth));
enddef;