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

Document window failed to auto scale after moving #637

Open
AdjWang opened this issue Jul 19, 2024 · 2 comments
Open

Document window failed to auto scale after moving #637

AdjWang opened this issue Jul 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@AdjWang
Copy link

AdjWang commented Jul 19, 2024

The issue

The demo program rmlui_sample_demo.exe shows a responsive document window auto scaling with the main window. The auto scaling would not work if drag and move it somewhere.

How to reproduce

vcpkg install freetype glfw3
git clone https://github.com/mikke89/RmlUi.git
cd RmlUi
cmake -B Build -S . --preset samples -DRMLUI_BACKEND=GLFW_GL3 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build Build
git log -1
commit 51af29b1b34c3d8c6b1790385e6584f004cfe3a9 (HEAD -> master, origin/master, origin/HEAD)
Author: Michael Ragazzon <[email protected]>
Date:   Sun Jul 14 18:24:36 2024 +0200

    Defer scroll offset clamping to after layout, fixes #452
  • Execute ./Build/Debug/rmlui_sample_demo.exe -> maximize window => works fine
    no_drag

  • Execute ./Build/Debug/rmlui_sample_demo.exe -> drag the document window somewhere -> maximize window => the document window is not scaling
    step1
    step2

@mikke89
Copy link
Owner

mikke89 commented Jul 24, 2024

Ah yes, this is really just how the handle element currently behaves, but I understand it might not be what one expects. When moving an element, the handle fixes the target's size, so that it doesn't accidentally resize it too. Hm, we could perhaps be smarter about how we do this though. Maybe it's fine to keep the right and bottom properties, but just adjust them accordingly so it doesn't change in size. I'll tinker a bit on it.

@mikke89 mikke89 added the enhancement New feature or request label Jul 24, 2024
@AdjWang
Copy link
Author

AdjWang commented Jul 25, 2024

Ok, thanks for consideration. I think maybe separate them in different way? Like in web, an out-of-flow window uses absolute position and sets left, top, right and bottom to move and scale; an in-flow window uses margin in px and width and height in percent to move and scale. The out-of-flow window never scale with the outer container while the in-flow one does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants