draw2d icon indicating copy to clipboard operation
draw2d copied to clipboard

Canvas.setDimensions accepts only numeric height/width

Open ittaysw opened this issue 11 months ago • 2 comments

The method checks if the values are a number. It then sets a csss and calls's rapael's setSize which sets height/width attributes. All of these accept non numeric values like '100%', '100px', etc. It would be nice if setDimension supports these. This just means not doing the checks.

ittaysw avatar Jan 29 '25 09:01 ittaysw

Also, note that in Canvas.init there's also a check for width and height in the form of !isNaN(parseFloat(width)) this check will pass if width is '100%' since parseFloat will return 100 which is a number. However, the intent is not for a 100 width canvas.

ittayd avatar Jan 29 '25 09:01 ittayd

I need absolute values. By using 100% scrolling of the canvas is not possible...in all cases

freegroup avatar Jan 29 '25 11:01 freegroup