llaske / sugarizer

Sugarizer is a web implementation of the Sugar platform to run on any device or browser
https://sugarizer.org
Apache License 2.0
197 stars 411 forks source link

In Paint activity on resizing the window it crops the canvas instead of resizing it #1100

Closed disha1202 closed 1 year ago

disha1202 commented 2 years ago

Current behaviour

screen-recorder-thu-sep-01-2022-17-44-12.webm

Expected behaviour

screen-recorder-thu-sep-01-2022-17-37-51.webm

llaske commented 2 years ago

The drawing should not be resized because it will lost its proportion. A drawing is not like an image. So it's not a bug.

disha1202 commented 2 years ago

The drawing should not be resized because it will lost its proportion. A drawing is not like an image. So it's not a bug.

Alright, if that is the case then maybe we can remove the onResize function (https://github.com/llaske/sugarizer/blob/dev/activities/Paint.activity/js/paint-activity.js#L53) and this line of code (https://github.com/llaske/sugarizer/blob/dev/activities/Paint.activity/js/paint-activity.js#L47)

@llaske What do you think?

llaske commented 2 years ago

I don't think so. The canvas should be resize in this event.

disha1202 commented 2 years ago

Yes, the canvas is resized when you change the screen size and on this resize event we have called a function onResize where the first line of code is a return statement. This function ends before performing any computation and will not affect the current behaviour if removed.

Please let me know if I'm missing something?

llaske commented 2 years ago

Oh :open_mouth: you're right! The Resize method is useless

disha1202 commented 2 years ago

So should we remove it?

llaske commented 2 years ago

@disha1202 yes please.