About   |   Getting Started   |   Downloads   |   Documentation   |   Forum


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Panel resizing.
04-10-2017, 02:18 AM
Post: #1
Panel resizing.
Hello. I have noticed an interesting behaviour with resizable panels. I add elements to the panel and in resize callback I retrieve this panels width so I can place elements on left side. When I drag the panel by the corner everything is great. However if I drag it by the left side there is a noticeable lag and some elements can end up outside of panel borders unless I drag it very slowly.
Find all posts by this user
Quote this message in a reply
04-10-2017, 08:10 AM
Post: #2
RE: Panel resizing.
upd: I meant right side by which I also dragged the panel. Widget position is a function from panel width
Find all posts by this user
Quote this message in a reply
04-10-2017, 11:09 AM
Post: #3
RE: Panel resizing.
I'm assuming this is on Windows?

As mentioned in another thread (I think it was one of yours), we have some significant under-the-hood changes to the Windows UI coming soon in a new version of CORE. I suspect this issue might already be resolved.

I cannot say for sure, but we should be able to release this new version in the next week or two.
Find all posts by this user
Quote this message in a reply
05-12-2017, 06:04 AM (This post was last modified: 05-12-2017 11:46 AM by garrett.)
Post: #4
RE: Panel resizing.
I've partially ported my project to new version of hdi_core and this issue is still present. And yes, this is on windows.
Find all posts by this user
Quote this message in a reply
05-30-2017, 02:52 PM
Post: #5
RE: Panel resizing.
My apologies for the delay. I will be looking into this issue this week. Can you please provide a bit of sample code that exhibits the problem, just so we're on the same page? Thanks.
Find all posts by this user
Quote this message in a reply
05-31-2017, 01:01 AM
Post: #6
RE: Panel resizing.
I've made some changes to PanelSample project to show this issue.

In postStartup I've changed panel creation lines to this
Code:
    this->__docPanel = hdi::core::Panel(
        "Current Doc Data",                                        // Panel title
        hdi::core::Size(hdi::core::Panel::typicalWidth, 140.0),    // Panel size
        true,                                                    // Width is not resizeable
        true                                                    // Height is not resizeable
    );
    this->__docPanel.setResizeCallback(HDI_CORE_CALLBACK(panel::Plugin, this, ResizeCallback));

And added resize callback
Code:
oid panel::Plugin::ResizeCallback()
{
    float w = this->__docPanel.frame().size.width;
    float h = this->__docPanel.frame().size.height;
    
    hdi::core::Point p(w - 50, 5);
    this->__docPanelSaveButton.setOrigin(p);
}

With this if you drag it by right edge fast(not corner, dragging by corner works fine), save button will show this behaviour
Find all posts by this user
Quote this message in a reply
06-06-2017, 10:42 AM
Post: #7
RE: Panel resizing.
After some investigation, I also see the issue you're describing.

The internal code to handle the resize callback from Illustrator is identical between Mac and Windows, and Mac does not exhibit this problem. I suspect that the underlying problem is how quickly the Windows message pump in Illustrator can issue messages regarding the window resize events (unfortunately all plugins are subject to Illustrator's handling of the message pump). We have seen this problem in other areas, like scheduling delayed callbacks (much slower on Windows than on Mac). So for each pixel the window is physically resized we are probably only getting a fraction of the events we should be receiving, e.g. every 5 px instead of every 1 px. As such, the "final" resize event for when the user has stopped moving their cursor might never be received at all Sad

However, I wonder why you are moving widgets manually to align them with the left side of the panel? If you create a widget at e.g. (10,10) then it will always be at (10,10) no matter which side/corner of the panel the user utilizes to resize said panel. As in, the widget will always be 10 pixels offset from the left of the panel and 10 pixels offset from the top of the panel, unless you manually move it to another coordinate.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)