From 62601fb4c7c7331866bf7a239f82984979f88ec0 Mon Sep 17 00:00:00 2001 From: Angelos Amyntas <61004068+amynang@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:59:34 +0200 Subject: [PATCH] Update abstract.jl solves #1045 (#1059) * Update abstract.jl The culprit behind #1045 was the use of poly! for user defined polygons. As a first step, I replaced it with `scatter!(p, p.pos; p.color, p.marker, p.markersize, p.agentsplotkwargs...)` and generating the plot with the custom polygon worked. In that case I think the whole if else statement is no longer necessary so I removed it. ``` if user_used_polygons(p.agent_marker[], p.marker[]) poly!(p, p.marker; p.color, p.marker, p.markersize, p.agentsplotkwargs...) else scatter!(p, p.pos; p.color, p.marker, p.markersize, p.agentsplotkwargs...) end ``` * fix issue with poly! * Update Project.toml --------- Co-authored-by: Adriano Meligrana <68152031+Tortar@users.noreply.github.com> --- Project.toml | 2 +- ext/AgentsVisualizations/src/spaces/abstract.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index d0e8a8a0ae..24956ab0b3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Agents" uuid = "46ada45e-f475-11e8-01d0-f70cc89e6671" authors = ["George Datseris", "Tim DuBois", "Aayush Sabharwal", "Ali Vahdati", "Adriano Meligrana"] -version = "6.0.16" +version = "6.0.17" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" diff --git a/ext/AgentsVisualizations/src/spaces/abstract.jl b/ext/AgentsVisualizations/src/spaces/abstract.jl index 99d7343557..bf74105594 100644 --- a/ext/AgentsVisualizations/src/spaces/abstract.jl +++ b/ext/AgentsVisualizations/src/spaces/abstract.jl @@ -3,7 +3,7 @@ Agents.agents_space_dimensionality(model::ABM) = function Agents.agentsplot!(ax::Axis, p::ABMP) if user_used_polygons(p.agent_marker[], p.marker[]) - poly!(p, p.marker; p.color, p.marker, p.markersize, p.agentsplotkwargs...) + poly!(p, p.marker; p.color, p.agentsplotkwargs...) else scatter!(p, p.pos; p.color, p.marker, p.markersize, p.agentsplotkwargs...) end