New CSSBoxWidget and lots of bug fixes#1135
Conversation
Allow centering images with auto-margins
Add support for auto horizontal margins
Codecov ReportBase: 51.09% // Head: 51.44% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1135 +/- ##
==========================================
+ Coverage 51.09% 51.44% +0.35%
==========================================
Files 11 17 +6
Lines 2018 2587 +569
==========================================
+ Hits 1031 1331 +300
- Misses 987 1256 +269
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
This is impressive work work Matthew! I am going to take it for a spin tomorrow. I have a bunch of experience with golden widget tests so if you like I can help with that. |
|
This is working really well. It's not that it solves all issues we had rioght now (and it doesn't need to) but it's a great foundation. I tested on Android and Web and rendering looks good. The code is looking good, evn though it's a bit tough to read through all changes. But that's okay, I'd rather have this base with a bug than the spaghetti we had right now sometimes. Good job @Sub6Resources |
erickok
left a comment
There was a problem hiding this comment.
This is amazing work. Consider my comments as just thoughts/considerations/future work, as it's really solid code. Great job!
| width = childSize.width + horizontalMargins; | ||
| height = childSize.height + verticalMargins; | ||
| break; | ||
| case Display.LIST_ITEM: |
There was a problem hiding this comment.
Just a thought: This might not be sufficient for list items that (via css) you force to a specific display: inline?
There was a problem hiding this comment.
I'm going to push this one off as future work. We've got a whole slew of list issues that need to be resolved so I'll tackle this when I start tackling those.
|
Going to go ahead and merge this since the most recent changes were pretty trivial, unit tests passed, and my visual tests look the same before and after. |
There's a lot going on in this branch but it's time for review.
tldr; Calculating widths/margins/padding/border is hard, so I made a new widget that replaces both ContainerSpan and StyledText. This refactor also caused a good chunk of Style code to need refactoring, so I did so, adding support for
em,rem,px,%, andautovalues on the margin/width/height properties.Fixes:
issue
autowidth and height is now the default, rather thannullEnhancements:
em,rem,px,auto, and%values to be used. (These extend a new Dimension class that does Unit checking to make sure only valid units are used)emvalues now used forh1-6andptag default margins and font sizes, which are more accurate at various font sizes.Notable breaking change: