render: compute image width/height in single function call
This commit is contained in:
parent
db9c382002
commit
4ba8550da8
7 changed files with 18 additions and 18 deletions
|
|
@ -304,7 +304,10 @@ impl GuiElement for Label {
|
|||
)
|
||||
.ok();
|
||||
let (tex, width, height) = match tex {
|
||||
Some((t, _)) => (Some(t.clone()), t.texture.width(), t.texture.height()),
|
||||
Some((t, _)) => {
|
||||
let (width, height) = t.texture.size();
|
||||
(Some(t.clone()), width, height)
|
||||
}
|
||||
_ => (None, 0, 0),
|
||||
};
|
||||
self.tex.set(tex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue