Hot Door CORE Forum

Full Version: Panel resizing.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
upd: I meant right side by which I also dragged the panel. Widget position is a function from panel width
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.
I've partially ported my project to new version of hdi_core and this issue is still present. And yes, this is on windows.
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.
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
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.