<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>What do you mean by resizable? Like you can select and resize a
rectangle like a Window? You want to be able to zoom in/out using
the scroll wheel?</p>
<p>If you want to make each individual rectangle resizable, you
probably want to use Nodes, probably a Shape node or one of its
sub types. You can then add support for handling certain events
(like drags, clicks, scrolls).</p>
<p>If you want to make some sort of drawing in a Canvas, and you
want to zoom in/out and/or pan the view, you'll have to redraw the
contents of the Canvas. I've done this before, where I was
displaying a map in a Canvas that allowed the user to zoom in/out
and pan the view. Redrawing a map consisting of 10.000's of
elements was quite responsive still.</p>
<p>--John<br>
</p>
<div class="moz-cite-prefix">On 30/07/2024 13:02, Davide Perini
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:8e19ecf6-31e5-497b-ab89-cabec9a74eb1@dpsoftware.org">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
Hi there,<br>
is there an easy way to make a shape resizable?<br>
<br>
Suppose that I draw a rectangle with<br>
<div style="background-color:#1e1f22;color:#bcbec4">
<pre
style="font-family:'JetBrains Mono',monospace;font-size:9,8pt;"><span
style="color:#c77dbb;">gc</span>.fillRect(x, y, z, h);</pre>
</div>
How am I supposed to make that shape resizable?<br>
I know that I can do it by draw the entire canvas again but it is
very tricky.<br>
<br>
Is there something that may help me doing it?<br>
<br>
Thanks<br>
Davide<br>
<br>
<br>
<br>
<br>
</blockquote>
</body>
</html>