The idea is to have a parent container (CanvasToScaleAndMove):
This container holds everything that needs to be moved and scaled inside and you transform that container. This will, in turn, transform everything within.
The calculations revolve around hardcoded numbers. If you scale or move things around, you need to account for those offsets. It’s a whole bunch of math.
I am not sure which of those elements you’re planning on moving and scaling:
But you’ll need to organise logically in such a way that the scroll boxes are excluded from those operations. I am assuming you do not want them moved / scaled as well.
I remember trying doing something like this with nested scroll boxes but couldn’t hack it back then. It was fairly long ago, though - perhaps it can be done.
Sorry, I can’t figure out what’s what. You seem to have so many things nested here…
I move and scale this widget WBP_GlobalMap
But this widget contains the scroll boxes? How are you expecting it to work? The elements that move it are the elements moving it? I am confused. But that would explain the wobble we saw in the anim. I was wondering what caused that, actually. Thought you implemented a fancy interpolated spring or something.
Judging by the above, you should be moving and scaling MapCanvas. I am unsure how to set it up with scrollboxes, they have offsets that I’ve always found somewhat difficult to work with.
I’m confused as well, so now i think i need to delete these scroll boxes, and implement other methods to move it left or right. And then try to make actor spawn where i want with a math.
If I remember correctly, the scroll boxes do not understand scaling (none of the slots do, I think) - the desired size of the widget does not change as you scale it. Even if you zoom in/out, the scroll box still sees the original size rather than the new dimensions affected by the scaling. Translation - panning should work fine, though.
That’s what I recall; not necessarily how it is. I remember someone mentioning (back on AnswerHub) that they used the example and successfully incorporated scrollboxes into it.
implement other methods to move it left or right.
In the thread I linked, all the calculations are shown. It even accounts for zooming onto the mouse cursor which I found somewhat challenging to figure out.
I just need this widget disappear for a moment, when i zoom or something
Because this method that you told, with deleting scroll boxes and all. Too complicated for my Big Brain, at least as i’m learning.
I think you understood how my “Map” system works, so maybe you can suggest me something, so this visible bug disappears