#Weird issue with text position

5 messages · Page 1 of 1 (latest)

fallow basin
#

For some reason these work:
style.position.left.try_add_assign(Val::Px(250.0)).ok();
style.position.top.try_add_assign(Val::Px(250.0)).ok();

But these don't do anything no matter what I set the value to:
style.position.right.try_add_assign(Val::Px(250.0)).ok();
style.position.bottom.try_add_assign(Val::Px(250.0)).ok();

I tried 25, 250, -250, nothing works. And I'm not getting any errors, the position of the text just doesn't change

prisma locust
#

make sure you're not setting both left+right and top+bottom, this is based off of how CSS works and you can only have one property on each axis (so top or bottom, left or right); left/top take precedence.

I tested this with:

position: UiRect {
    top: Val::Px(5.0),
    left: Val::Px(5.0),
    ..default()
}

and:

position: UiRect {
    bottom: Val::Px(5.0),
    right: Val::Px(5.0),
    ..default()
}

both worked as expected

#

I think you could just set left/top to Val::Undefined if you want to switch though

fallow basin
#

I see

#

I'm basically setting the initial position using top and left but then I'm trying to change it using right.