maybe fix relative len for sized span
This commit is contained in:
@@ -51,7 +51,7 @@ impl Widget for Span {
|
|||||||
let dir_len = if total.ratio != 0.0 {
|
let dir_len = if total.ratio != 0.0 {
|
||||||
ctx.size.axis(axis)
|
ctx.size.axis(axis)
|
||||||
} else {
|
} else {
|
||||||
total.fixed + total.relative * ctx.screen_size.axis(axis)
|
total.fixed + total.relative * ctx.size.axis(axis)
|
||||||
};
|
};
|
||||||
Vec2::from_axis(axis, dir_len, total.max_sized)
|
Vec2::from_axis(axis, dir_len, total.max_sized)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ impl<'a> Painter<'a> {
|
|||||||
|
|
||||||
pub fn size_ctx(&mut self) -> SizeCtx {
|
pub fn size_ctx(&mut self) -> SizeCtx {
|
||||||
SizeCtx {
|
SizeCtx {
|
||||||
screen_size: self.screen_size,
|
|
||||||
size: self.region().in_size(self.screen_size),
|
size: self.region().in_size(self.screen_size),
|
||||||
text: self.text,
|
text: self.text,
|
||||||
textures: self.textures,
|
textures: self.textures,
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ pub trait Widget: Any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct SizeCtx<'a> {
|
pub struct SizeCtx<'a> {
|
||||||
pub screen_size: Vec2,
|
|
||||||
pub size: Vec2,
|
pub size: Vec2,
|
||||||
pub text: &'a mut TextData,
|
pub text: &'a mut TextData,
|
||||||
pub textures: &'a mut Textures,
|
pub textures: &'a mut Textures,
|
||||||
|
|||||||
Reference in New Issue
Block a user