Clean up use of transforms in scene graph.
This commit is contained in:
parent
3915a40c96
commit
f26ee2ebc4
37 changed files with 238 additions and 242 deletions
|
@ -14,10 +14,8 @@
|
|||
|
||||
#include "StringUtils.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
TextNode::TextNode(const std::string& content, const Point& loc)
|
||||
: MaterialNode(loc)
|
||||
TextNode::TextNode(const std::string& content, const Transform& transform)
|
||||
: MaterialNode(transform)
|
||||
{
|
||||
mTextData.mContent= content;
|
||||
}
|
||||
|
@ -27,9 +25,9 @@ TextNode::~TextNode()
|
|||
|
||||
}
|
||||
|
||||
std::unique_ptr<TextNode> TextNode::Create(const std::string& content, const Point& loc)
|
||||
std::unique_ptr<TextNode> TextNode::Create(const std::string& content, const Transform& transform)
|
||||
{
|
||||
return std::make_unique<TextNode>(content, loc);
|
||||
return std::make_unique<TextNode>(content, transform);
|
||||
}
|
||||
|
||||
std::string TextNode::getFontLabel() const
|
||||
|
@ -168,10 +166,10 @@ void TextNode::update(SceneInfo* sceneInfo)
|
|||
|
||||
if (mTransformIsDirty)
|
||||
{
|
||||
mTextItem->updateTransform({mLocation});
|
||||
mTextItem->setTextWidth(mWidth);
|
||||
mTextItem->setTextHeight(mHeight);
|
||||
mTransformIsDirty = false;
|
||||
//mTextItem->updateTransform({mLocation});
|
||||
//mTextItem->setTextWidth(mWidth);
|
||||
//mTextItem->setTextHeight(mHeight);
|
||||
//mTransformIsDirty = false;
|
||||
}
|
||||
|
||||
if (mMaterialIsDirty)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue