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
198 stars 411 forks source link

Fototoon don't handle window resize #559

Open s-mag opened 4 years ago

s-mag commented 4 years ago

Fototoon activity don't handle window resize event. So, if the activity is open with a small window then resized, the board keep the same size.

ft
llaske commented 4 years ago

Yes, it's a bug.

saurabhhere commented 3 years ago

Hi, I tried solving this issue but got to know that we can change the size of the canvas while the window resizes but can't change the size of elements existing inside it.

Preview:

FotoToon Canvas Responsive

When I checked why actually this is happening then I got to know that the values of elements (i.e. x-coordinate, y-coordinate, height, width, and other properties) existing inside canvas updates only when the user presses the stop button.

You can see how values are fixed here:

imageedit_4_9672469593

Also due to this if the user refreshes the window at any moment in between then it will retrieve the last data stored (when pressed the stop button) on the canvas. If any user wants to update the size or text of any element then he has to do that manually and press the stop button to save it in the journal.

I may be wrong but I don't think we can update the size of elements inside the canvas while resizing the window. But yes, We can update the size of the canvas while resizing.

Opinions will be highly appreciated.

llaske commented 3 years ago

Hmmm. I agree that it's complex to resize elements inside the canvas. BTW we could resize the canvas and center content in the canvas. So if the current window size is larger than the initial size the content will not appear in the top left corner.

saurabhhere commented 3 years ago

Regarding the content in the canvas, they are not controlled using media queries here. So they will remain in the same x, y coordinates always until the user drags them to a new position and saves it using the stop button. Content will not appear in the top left corner, it will remain in its position when the window resizes.

Preview of what I am saying:

FotoToon

But we can update the size of Canvas and images imported from the journal when window resizes.

Preview:

FotoToon_images

I will send the PR if this looks good to you.

llaske commented 3 years ago

Sounds good.

Vishalk91-4 commented 1 year ago

https://github.com/llaske/sugarizer/pull/909#issuecomment-749216194 @llaske, Can you please explain this point, I couldn't get what did differ from what you want

llaske commented 1 year ago

#909 (comment) @llaske, Can you please explain this point, I couldn't get what did differ from what you want

In a comic the globe is use to show a character speaking. So it's important to locate it near the character's mouth. If the image is resized but the globe is not moved it will not appear to be near the character's mouth.