From 511a8d19d4b35d89c68446e4bb8eb2c04171e01d Mon Sep 17 00:00:00 2001 From: Ted Moore Date: Wed, 3 Nov 2021 15:14:51 +0000 Subject: [PATCH] initialize with internal dict a plotter initialized with no 'dict' now makes an empty internal dict so that one can use 'setPoint' and 'addPoint' right off the bat --- release-packaging/Classes/FluidPlotter.sc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release-packaging/Classes/FluidPlotter.sc b/release-packaging/Classes/FluidPlotter.sc index f2637a0..601b001 100644 --- a/release-packaging/Classes/FluidPlotter.sc +++ b/release-packaging/Classes/FluidPlotter.sc @@ -34,6 +34,7 @@ FluidPlotter { ymax = ymax_; this.createCatColors; + dict_internal = Dictionary.new; if(dict_.notNil,{this.dict_(dict_)}); this.createPlotWindow(bounds,parent_,mouseMoveAction,dict_); } @@ -47,7 +48,7 @@ FluidPlotter { categories_ { arg labelSetDict; - if(dict_internal.notNil,{ + if(dict_internal.size == 0,{ var label_to_int = Dictionary.new; var counter = 0; dict_internal.keysValuesDo({ @@ -98,7 +99,9 @@ FluidPlotter { setPoint_ { arg identifier, x, y, color, size = 1; + dict_internal.put(identifier,FluidPlotterPoint(identifier,x,y,color ? Color.black,size)); + this.refresh; }