You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, this is an awesome project and I really appreciate everyone putting their effort into it.
While working on react-slate (a React renderer for terminal in Node JS), which is based on Stretch, I noticed that, when setting width/height, basically any Dimension property as a percentage, it is converted to plain Points:
setting width to 100% will result in Points(100) being used in layout calculations.
I've done some digging and found one line of code, which might be causing that in get_dimension function in bindings/js:
@zamotany You are totally right. My bad. Yeah if you would like to make a PR (and add a test for it so I don't mess up again ^^) that would be awesome. Let me know, otherwise I'll write a fix for it when I have some downtime.
btw react-slate looks awesome! Congrats on a successful project 💯
Also sorry for the delay in getting back to you on this.
Any chance we can get this fix merged ? I'm looking into replacing yoga-layout in my own project with stretch-layout but the broken percentage dimensions is a showstopper.
First of all, this is an awesome project and I really appreciate everyone putting their effort into it.
While working on react-slate (a React renderer for terminal in Node JS), which is based on Stretch, I noticed that, when setting
width
/height
, basically anyDimension
property as a percentage, it is converted to plainPoints
:setting
width
to100%
will result inPoints(100)
being used in layout calculations.I've done some digging and found one line of code, which might be causing that in
get_dimension
function inbindings/js
:stretch/bindings/js/src/lib.rs
Lines 608 to 613 in a7e2c07
Shouldn't this
if let
returnreturn stretch::style::Dimension::Percent(number / 100);
?I'm happy to do a PR to fix that, but wanted a feedback before doing so.
The text was updated successfully, but these errors were encountered: