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

Overflow-X not working properly #94

Closed
uniquejack opened this issue Apr 1, 2020 · 2 comments
Closed

Overflow-X not working properly #94

uniquejack opened this issue Apr 1, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@uniquejack
Copy link

uniquejack commented Apr 1, 2020

When I use white-space: nowrap, overflow-x: scroll and max-width on a container, the container stretches to the size of the children elements.

How to reproduce:
demo.txt

The size of the window body doesn't get 100px, but it gets as big as the content gets.

EDIT: same issue in the databinding branch.

@uniquejack
Copy link
Author

I think I found the problem:
LayoutBlockBox.cpp line 229:

if (!wrap_content) box.SetContent(Vector2f(content_box.x, box.GetSize().y));
Why are we disabling the overflow-x when wrapping is disabled? should actually be the opposite

@mikke89 mikke89 added the bug Something isn't working label May 30, 2020
@mikke89
Copy link
Owner

mikke89 commented Jun 13, 2020

Thank you! I don't see why the box should ever be extended at this point. I removed the condition you refer to which should fix this particular issue.

@mikke89 mikke89 closed this as completed Jun 13, 2020
Unicornum added a commit to Unicornum/Externals.RmlUi that referenced this issue Aug 1, 2020
* Create data binding sample

* add virtual dcon to Rml::Core::Releasable

* Fix CMake 3.17 STRING warning

CMake Warning (dev) at CMakeLists.txt:29 (set):
  implicitly converting 'string' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

* Update number parser procedure. Fixes mikke89#102. Improves performance.

* X11 Shell: Consider additional paths for the assets directory. More robust, and makes remote compilation/debugging on WSL from Visual Studio work with default configuration.

* Use the F8 key to toggle the debugger on all platforms.

* Fix warnings on GCC and Clang with -Wall -pedantic

* Fix warning on MSVC

* Travis: Add warning and pedantic compilation flags

* Fix some additional warnings in GCC

* Property 'white-space: nowrap' should not disable scrollbars on overflow. See mikke89#94.

* Dirty font effects when the 'font-effect' property is changed. Fixes mikke89#98.

* Fix structural pseudo-selectors only being applied if written with parenthesis. See mikke89#30.

* Remove the StringCache. See mikke89#96.

* Windows shell: Add another candidate path for the samples folder search.

* Selection box: Prevent scrolling the parent window when hovering over the drop down list.

* Select element: Close select box if parent document is scrolled.

* Reduce memory allocations while parsing the 'style' attribute.

* Do not require a final semi-colon while parsing the 'style' attribute.

* Fix possible wrong layout in widget slider

* Make project C++20 compatible

* CMake: Enable the C++14 standard project-wide.

* Element 'select': Automatically position and size the selection box to the available space within the context's window dimensions. See mikke89#91.

* ShellX11: Load and activate mouse cursors.

* Update changelog.

* Fix geometry not setting its host element or context on construction

* Several warnings fixed with '-Wall -Wextra' and on MSVC with '/W4'.

* Enhanced Tracy profiler CMake configuration. Add separate build configuration.

* Element 'select': Respect 'height' property on selectbox set by user in style sheet.

* Add missing include

* Fix SFML and SDL samples on Windows.

* Add sdl2_image include to CMakeLists.txt

* Fix tiled decorator alignment not working.

* Release RmlUi 3.3

* Start working on RmlUi 4.0

* Update gitignore

* Debugger: Display contents of text elements

* Debugger: Use pre-wrap in event log. Display beacon if messages are logged during application start-up.

* Try fixing problems from the None macro in X11 (ugh)

* Add forward to flat_map and flat_set emplace

* XMLNodeHandlerTabSet: 'tabs' and 'panels' should return null

* Basic implementation of data binding (WIP)

* Make DataViewText take a text element, replacing its text contents with the data binding.

* Set values on data view constructions. Add attribute view.

* Remove handling of data binding in xml parser

* Add data controller for attributes

* Make slider widget update attribute on value change

* Update utf8 string iterator

* Add DataViewIf

* Make Variant constructors explicit

* Variant: Add bool, double, int64 types, remove word.

* Add type converters for double, int64_t

* Implement data types

* Refactor data bindings

* Add data view for style

* Start implementing data view 'for' (highly WIP)

* Experimenting with approach for nested variables in structs and arrays.

* Data variables address parsing and get/set values

* Make data arrays safer, no need for Update

* Refactor, move the new data variable types into the library. Now working 'for' loops for structs.

* Custom iterator name in data-for

* Better parsing in data-for: Nested for loops now work.

* Safely add and remove data views during iteration, and clean up data views on element removal.

* Only update dirty data variables

* Some cleanup

* Getters and setters for data struct members

* Add arbitrary get/set functions as data binding

* Clean up data binding API

* Update data controller

* Data types now associated with the Context. Clean up data model.

* Move creation of data views and controllers to ElementUtilities. Clean up.

* Data views: recursively update

* Start creating a parser for data views

* Trim trailing zeros in float converted to String. Remove PrettyFormatNumbers from debugger.

* Add data expression transform functions (callbacks).

* Add data-class and data-rml

* XML Parser: Ignore <tags> in {{ double brackets }}

* Read in whole document in xml parser before parsing.

* Handle raw inner xml contents of data-for elements more robustly.

* Some refactoring of DataViews. Move the default DataViews to separate files.

* - Implemented 'data-event' controller. Can use assignment in its expression, and also 'ev.' variable name to fetch parameters from the event.
- Move default controllers to separate file.
- The 'data-value' controller now uses the 'change' event to listen for value changes.
- Get size on data array variables by .size member.

* Make initialization of data views and controllers safer

* Update comments. Generalize XMLParser. Data model and variables refactoring.

* Add additional operator precedence in data parser. Add more tests. Add format() and round() transform functions to data parser.

* Robustify text elements from illegal syntax.

* Better warnings.

* Start data binding example with invaders

* Implement it_index in data view for. Rename some functions.

* Add data view: visible

* Clean up data binding sample, add a basic example.

* Fix headers

* In Element: Set parent just after inserting child element.

* Add missing headers

* Add ability to retrieve an existing data model from Context.

* DataModel make views and controllers internal.

* Rename DataParser file to DataExpression. Some cleanup.

* Fix removal of event listener in data-event.

* Enable removal of data model from context.

* Unify parsing of curly brackets in RML.

* The big restructuring for RmlUi 4.0. This involves breaking changes but should benefit everyone using the library in the future.

- The old `Controls` plugin is now gone. But fear not! It has been merged into the `Core` project .
- The old `Rml::Core` and `Rml::Controls` namespaces are now located directly in the `Rml` namespace.
- The old `Controls` public header files have been moved to `<RmlUi/Core/Elements/...>`.
- The old `Controls` source files and private header files have been moved to `Source/Core/Elements/...`.
- The `Debugger` plugin remains as before at the same location and same namespace `Rml::Debugger`.

The Lua plugins have been changed to reflect the above changes.

- The old Lua plugins `RmlCoreLua` and `RmlControlsLua` have been merged into a single library `RmlLua`.
- The public header files are now located at `<RmlUi/Lua/...>`.
- The Lua plugin is now initialized by calling `Rml::Lua::Initialise()` located in `<RmlUi/Lua/Lua.h>`.
- Separated the Lua interpreter functions from initialization and the Lua plugin.
- Renamed macros in the Lua plugin, they now start with `RMLUI_`.

Related changes.

- Refactored slider widgets to avoid duplicate names in Core and Controls.
- Renamed header guard macros.

* Update changelog

* Add some missing files to RmlUi/Core.h

* Refactor some of the Transform functionality. Move functions that should only be called internally to an internal TransformUtilities. Rename Transforms::Primitive to TransformPrimitive.

* Initialize OpenGL viewport directly before rendering the gui

* Add view to sfml2 example

* Remove Resize method

* Update readme

* Fix compilation and warnings in shared libraries.

* Update changelog

* Fix mingw build

* Move target_link_libraries to shell, and rename WIN32 to RMLUI_PLATFORM_WIN32

* Fix win32 shell compilation issue in some environments.

* Add a note for the lifetime requirement of 'LoadFontFace' from memory.

* Add FamilyId to std::hash.

* Add MinGW build to AppVeyor configuration. Small tweak to Travis.

* Fix warning in SFML sample.

* Initial document_base_tag branch

* code cleanup

* Implement `Element::QuerySelector` and `Element::QuerySelectorAll`.

* Fix build with EASTL when it is configured to use size_type different from size_t.

* Add ability for user to override container types.

Resolves mikke89#107.

* Extend example of custom type conversion operators.

* Update Include/RmlUi/UserConfig.h

Co-authored-by: Michael R. P. Ragazzon <mikke89@users.noreply.github.com>
Update Include/RmlUi/Core/Types.h

Co-authored-by: Michael R. P. Ragazzon <mikke89@users.noreply.github.com>

* Move config file into a subdir and include it in Traits.h and Types.h

* Some cleanup and warning fixes.

* Update CMake for custom configuration.

Co-authored-by: Michael Ragazzon <michael.ragazzon@gmail.com>
Co-authored-by: SpaceCat~Chan <49094338+SpaceCat-Chan@users.noreply.github.com>
Co-authored-by: Michael R. P. Ragazzon <mikke89@users.noreply.github.com>
Co-authored-by: Jan Niklas Hasse <jhasse@bixense.com>
Co-authored-by: Karsten Hachmeister <karsten@hachmeister.org>
Co-authored-by: Cloud Wu <cloudwu@gmail.com>
Co-authored-by: aquawicket <aquawicket@hotmail.com>
Co-authored-by: Rokas Kupstys <rokups@zoho.com>
Co-authored-by: Rokas Kupstys <19151258+rokups@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants