Skip to content

Commit 2f04d04

Browse files
committed
bugfix
1 parent f60d0d0 commit 2f04d04

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/spatialdata_plot/pl/render.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ def _render_shapes(
9090
else:
9191
table = sdata.table[sdata.table.obs[_get_region_key(sdata)].isin(elements)]
9292

93-
# refactor plz, squidpy leftovers
94-
render_params.outline_params.bg_color = (0.83, 0.83, 0.83, render_params.fill_alpha)
95-
9693
# get color vector (categorical or continuous)
9794
color_source_vector, color_vector, _ = _set_color_source_vec(
9895
adata=table,
@@ -144,7 +141,7 @@ def _get_collection_shape(
144141
fill_c[..., -1] = render_params.fill_alpha
145142

146143
if render_params.outline_params.outline:
147-
outline_c = ColorConverter().to_rgba_array(c)
144+
outline_c = ColorConverter().to_rgba_array(render_params.outline_params.bg_color)
148145
outline_c[..., -1] = render_params.outline_alpha
149146
else:
150147
outline_c = None
Loading

tests/pl/test_render_shapes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ class TestShapes(PlotTester, metaclass=PlotTesterMeta):
2222
def test_plot_can_render_circles(self, sdata_blobs: SpatialData):
2323
sdata_blobs.pl.render_shapes(element="blobs_circles").pl.show()
2424

25+
def test_plot_can_render_circles_with_outline(self, sdata_blobs: SpatialData):
26+
sdata_blobs.pl.render_shapes(element="blobs_circles", outline=True).pl.show()
27+
2528
def test_plot_can_render_polygons(self, sdata_blobs: SpatialData):
2629
sdata_blobs.pl.render_shapes(element="blobs_polygons").pl.show()

0 commit comments

Comments
 (0)