Browse code

reset link_gp to NA

Zuguang Gu authored on 31/05/2020 12:23:31
Showing1 changed files

... ...
@@ -3475,6 +3475,7 @@ anno_zoom = function(align_to, panel_fun = function(index, nm = NULL) { grid.rec
3475 3475
 		}
3476 3476
 		popViewport()
3477 3477
 		# draw the links
3478
+		if(is.null(link_gp$fill)) link_gp$fill = NA
3478 3479
 		link_gp = recycle_gp(link_gp, n_boxes)
3479 3480
 		if(side == "right") {
3480 3481
 			pushViewport(viewport(x = unit(0, "npc"), just = "left", width = link_width))
... ...
@@ -3485,7 +3486,7 @@ anno_zoom = function(align_to, panel_fun = function(index, nm = NULL) { grid.rec
3485 3486
 			df = align_to_df[[i]]
3486 3487
 			for(j in 1:nrow(df)) {
3487 3488
 				# draw each polygon
3488
-				if(!internal_line && "col" %in% names(link_gp)) {
3489
+				if(!internal_line) {
3489 3490
 					link_gp3 = link_gp2 = link_gp
3490 3491
 					link_gp2$col = link_gp$fill
3491 3492
 					link_gp2$lty = NULL
... ...
@@ -3647,6 +3648,7 @@ anno_zoom = function(align_to, panel_fun = function(index, nm = NULL) { grid.rec
3647 3648
 		}
3648 3649
 		popViewport()
3649 3650
 		# draw the links
3651
+		if(is.null(link_gp$fill)) link_gp$fill = NA
3650 3652
 		link_gp = recycle_gp(link_gp, n_boxes)
3651 3653
 		if(side == "top") {
3652 3654
 			pushViewport(viewport(y = unit(0, "npc"), just = "bottom", height = link_height))
... ...
@@ -3657,7 +3659,7 @@ anno_zoom = function(align_to, panel_fun = function(index, nm = NULL) { grid.rec
3657 3659
 			df = align_to_df[[i]]
3658 3660
 			for(j in 1:nrow(df)) {
3659 3661
 				# draw each polygon
3660
-				if(!internal_line && "col" %in% names(link_gp)) {
3662
+				if(!internal_line) {
3661 3663
 					link_gp3 = link_gp2 = link_gp
3662 3664
 					link_gp2$col = link_gp$fill
3663 3665
 					link_gp2$lty = NULL