Layouts (#189)
* Layout WIP * Widgets/BoxLayout: Fix layout algorithm * Widgets/BoxLayout: Fix box layout algorithm for good * SDK/Widgets: Remove padding * Sdk/Widgets: Make use of minimum/preferred size * Sdk/TextAreaWidget: Add Minimum/PreferredSize to TextArea * Sdk/Widgets: Add height/width variants of get/set fixed, maximum, minimum and preferred size methods * Sdk/BoxLayout: Remove useless code * Sdk/TextAreaWidget: Fix compilation * Widgets/TextAreaWidget: Fix cursor position
This commit is contained in:
@@ -26,12 +26,13 @@ namespace Ndk
|
||||
m_sprite->SetColor(color);
|
||||
}
|
||||
|
||||
inline void ImageWidget::SetTexture(const Nz::TextureRef& texture, bool resizeToContent)
|
||||
inline void ImageWidget::SetTexture(const Nz::TextureRef& texture)
|
||||
{
|
||||
m_sprite->SetTexture(texture, false);
|
||||
|
||||
if (resizeToContent)
|
||||
ResizeToContent();
|
||||
Nz::Vector2f textureSize = Nz::Vector2f(Nz::Vector2ui(m_sprite->GetMaterial()->GetDiffuseMap()->GetSize()));
|
||||
SetMinimumSize(textureSize);
|
||||
SetPreferredSize(textureSize);
|
||||
}
|
||||
|
||||
inline void ImageWidget::SetTextureCoords(const Nz::Rectf& coords)
|
||||
|
||||
Reference in New Issue
Block a user