Open xilexio opened 1 year ago
@shanemadden This can be closed, since it is old and no longer true.
It can be accomplished like so:
let rv = RoomVisual::new(None);
rv.circle(
10.0,
10.0,
Some(CircleStyle::default().fill("blue").radius(5.0)),
);
undefined
isn't valid JSON anyway and gets removed when serialized.
And it will be serialized because it gets send to the client for remote execution.
In JS, it is possible to supply to, e.g.,
RoomVisual.circle
options withIt means that there should be no stroke and is different from empty options
{}
which mean that the stroke should be default (rather thick and light).Currently in the API it is impossible to supply an undefined stroke. The stroke can either be
None
meaning default orSome(x)
meaning widthx
, there is noundefined
option that means no stroke. A working workaround is supplying transparent stroke color or extremely small (but positive or else it will not work) stroke width. However, this approach requires the stroke data to be sent to the client which needlessly uses up more of the already small (when visualizing something in the whole room) 500kB limit.