Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing a panel from the left to a contained limit is buggy #155

Open
kirat68 opened this issue Feb 27, 2021 · 3 comments
Open

Resizing a panel from the left to a contained limit is buggy #155

kirat68 opened this issue Feb 27, 2021 · 3 comments
Labels
info information only

Comments

@kirat68
Copy link

kirat68 commented Feb 27, 2021

Hello there,
Thank you for this nice piece of code.
Could you check this issue when resizing a panel to the left using containment ?
I have attached a video to show the problem that I think is related to the line 4211 of jspanel.js

   if (w <= maxWidth && w >= minWidth && w <= maxWidthWest) {

---> self.style.left = startLeft + (eventX - startX) / scaleFactor.x + xDif + 'px';
}

simplescreenrecorder-2021-02-27_13.06.53.mp4
@Flyer53
Copy link
Owner

Flyer53 commented Feb 27, 2021

@kirat68
Hi there ... and thanks for the praise 😄
Well, I'm aware of this issue already (although I didn't observe it as severe as in your demo video yet). The point is that there are a lot of calculations going on in this process. The panel has to be resized and repositioned and checked for the containment settings, and all simultaneously. That seems to be heavy on the CPU. And yes, the way I programmed that could most probably be improved.
I might try a different approach when I recode the complete resizeit interaction. But I don't think this will happen within v4.x.x.
So for the time being you have to live with it, sorry.
Regards,
Stefan

@kirat68
Copy link
Author

kirat68 commented Feb 28, 2021

Bonjour !
Thank you for your quick answer !
Yes, I see how complex the code is at that place and do not understand all involved interactions.
But would it be not enough to add this line of code:

            if (w >= maxWidthWest) {
         +   self.style.left = opts.containment[1];
              w = maxWidthWest;
            } 

At least for now it solves this specific bug, but I don't know if it has an impact other functionalities.

@Flyer53
Copy link
Owner

Flyer53 commented Feb 28, 2021

Hi again,
Your welcome! Well, all those checks are there for a reason. Option resizeit allows for quite a few parameters. And those parameters need to be checked while resizing a panel. Otherwise they wouldn't make a lot of sense, don't you think so?
Sure, the code could be improved to remove such issues. But as said, this will probably have to wait until I either completely recode the resizeit interaction or start with a new major version of jsPanel.

Happy coding ... and stay healthy,
Stefan

@Flyer53 Flyer53 added the info information only label Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info information only
Projects
None yet
Development

No branches or pull requests

2 participants