Browse code

internally construct padding as unit when it is set as numeric values

Zuguang Gu authored on 24/10/2019 19:00:52
Showing1 changed files

... ...
@@ -2777,6 +2777,10 @@ anno_mark = function(at, labels, which = c("column", "row"),
2777 2777
 
2778 2778
 	labels_rot = labels_rot %% 360
2779 2779
 
2780
+	if(!inherits(padding, "unit")) {
2781
+		padding = convertHeight(padding*grobHeight(textGrob("a", gp = subset_gp(labels_gp, 1))), "mm")
2782
+	}
2783
+
2780 2784
 	# a map between row index and positions
2781 2785
 	# pos_map = 
2782 2786
 	row_fun = function(index) {