From f277b2a0662ee77e580b687ef608e5491bcb1e55 Mon Sep 17 00:00:00 2001 From: ryantimpe Date: Sun, 27 Oct 2019 12:36:41 -0400 Subject: [PATCH] Issue #17 Correctly displays allowed bricks in the build_bricks() output. --- R/build-mosaic.R | 5 ++++- R/collect-bricks.R | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/R/build-mosaic.R b/R/build-mosaic.R index f7499fa..8593363 100644 --- a/R/build-mosaic.R +++ b/R/build-mosaic.R @@ -11,11 +11,14 @@ build_mosaic <- function(brick_obj, title=NULL){ image <- in_list$Img_bricks type <- in_list$mosaic_type + use_bricks <- in_list$use_bricks + coord_x <- c(min(image$xmin)+0.5, max(image$xmax)-0.5) coord_y <- c(min(image$ymin)+0.5, max(image$ymax)-0.5) img <- ggplot2::ggplot(in_list$Img_lego, ggplot2::aes(x=x, y=y)) + - geom_brick_rect(ggplot2::aes(fill = Lego_color), color = "#333333")+ + geom_brick_rect(ggplot2::aes(fill = Lego_color), color = "#333333", + use_bricks = use_bricks)+ ggplot2::scale_fill_identity() + ggplot2::coord_fixed(expand = 0.5) diff --git a/R/collect-bricks.R b/R/collect-bricks.R index 826de1b..064c6bc 100644 --- a/R/collect-bricks.R +++ b/R/collect-bricks.R @@ -112,6 +112,7 @@ collect_bricks <- function(image_list, use_bricks = NULL){ in_list[["Img_bricks"]] <- img2 in_list[["ID_bricks"]] <- bricks_df in_list[["pieces"]] <- pcs + in_list[["use_bricks"]] <- use_bricks return(in_list) }