Browse code

text positions are now correctly calculated in anno_mark()

Zuguang Gu authored on 04/07/2019 06:48:48
Showing1 changed files

... ...
@@ -2855,7 +2855,7 @@ anno_mark = function(at, labels, which = c("column", "row"),
2855 2855
 			grid.segments(pos, rep(link_height*(1/3), n2), h, rep(link_height*(2/3), n2), default.units = "native", gp = link_gp)
2856 2856
 			grid.segments(h, rep(link_height*(2/3), n2), h, rep(link_height, n), default.units = "native", gp = link_gp)
2857 2857
 		} else {
2858
-			grid.text(labels, h, rep(max_text_width(labels, gp = labels_gp), n2), default.units = "native", gp = labels_gp, rot = labels_rot, just = "right")
2858
+			grid.text(labels, h, unit(1, "npc")-rep(link_height, n2), default.units = "native", gp = labels_gp, rot = labels_rot, just = "right")
2859 2859
 			link_height = link_height - unit(1, "mm")
2860 2860
 			grid.segments(pos, unit(rep(1, n2), "npc"), pos, unit(1, "npc")-rep(link_height*(1/3), n2), default.units = "native", gp = link_gp)
2861 2861
 			grid.segments(pos, unit(1, "npc")-rep(link_height*(1/3), n2), h, unit(1, "npc")-rep(link_height*(2/3), n2), default.units = "native", gp = link_gp)