Comments (3)
Should be fixed by #75
from elementa.
Should be fixed by #75
I wish itβd get merged, itβs more than a year since π
from elementa.
I've closed the referenced PR as it has several shortcomings that make it unfit for general use.
If it works in your case, you could just create a local copy of it for your use.
Internally we've come to do something similar but with different tradeoffs than that PR, namely that it accounts for all SiblingConstraint
-induced padding (or more generally any PaddingConstraint
-induced padding) but not any offset induced in any other way. In particular your y = SiblingConstraint(3f) + 5f.pixels
(which, given the aren't any preceding siblings (?) is just 5.pixels
) wouldn't work. We've come to instead use dummy spacer components of appropriate size whenever we need extra padding at the very start/end.
Here's the relevant part of FillConstraint (at least the width; height works analogous) which we've modified:
return if (useSiblings) {
target.getWidth() - target.children.filter { it != component }.sumOf {
it.getWidth().toDouble() + ((it.constraints.x as? PaddingConstraint)?.getHorizontalPadding(it) ?: 0f).toDouble()
}.toFloat()
} else target.getRight() - component.getLeft() + ((target.constraints.x as? PaddingConstraint)?.getHorizontalPadding(target) ?: 0f)
Beware that we only ever use it with useSiblings = true
, so that else
case is completely untested (and looking at it, idk what that's supposed to do; doesn't look right to me).
from elementa.
Related Issues (20)
- Message Preview Selection HOT 1
- [Craftify (based on Elementa)] Elementa crashes after a while of leaving the game open, killing the Craftify GUI. HOT 12
- Fix Elementa ScrollComponent
- Unify units of time throughout the project HOT 2
- Add support for rounded images through shaders HOT 1
- Support for displaying a UScreen as an Elementa component HOT 2
- README.md install instructions do not seem to be up to date and a little bit vague HOT 1
- UIImage eats exceptions due to CompletableFuture
- Customisable Scroll Animation
- java.lang.NoClassDefFoundError: net/minecraft/class_310 HOT 8
- StencilEffect doesn't work on 1.18 HOT 1
- Elementa throws NoSuchElementException when using empty lists in Markdown Component
- Encourage use of `by` instead of `=`
- MSDF FontRenderer misaligned text height
- ExampleGui.kt not working correctly
- 1.19+ HOT 1
- Improve Docs
- Update components docs page
- MarkdownComponent: NotImplementedError in certain edge cases with blank markdown
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elementa.