Clean up of scene nodes to support 2d and non int positioning.
This commit is contained in:
parent
1eeaebd0a9
commit
672b31b603
45 changed files with 341 additions and 200 deletions
|
@ -1,49 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "MaterialNode.h"
|
||||
|
||||
#include "FontItem.h"
|
||||
#include "TextData.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class TextNode : public MaterialNode
|
||||
{
|
||||
public:
|
||||
TextNode(const std::string& content, const DiscretePoint& loc);
|
||||
|
||||
~TextNode();
|
||||
|
||||
static std::unique_ptr<TextNode> Create(const std::string& content, const DiscretePoint& loc);
|
||||
|
||||
std::string getContent() const;
|
||||
std::string getFontLabel() const;
|
||||
|
||||
SceneItem* getSceneItem(std::size_t idx) const override;
|
||||
unsigned getNumSceneItems() const override;
|
||||
|
||||
unsigned getWidth() const;
|
||||
unsigned getHeight() const;
|
||||
|
||||
void setWidth(unsigned width);
|
||||
void setHeight(unsigned height);
|
||||
|
||||
void setContent(const std::string& content);
|
||||
|
||||
void update(FontsManager* fontsManager) override;
|
||||
private:
|
||||
|
||||
void updateLines(FontsManager* fontsManager);
|
||||
|
||||
TextData mTextData;
|
||||
bool mContentIsDirty{true};
|
||||
bool mLinesAreDirty{true};
|
||||
|
||||
unsigned mWidth{1};
|
||||
unsigned mHeight{1};
|
||||
|
||||
std::unique_ptr<SceneItem> mTextItem;
|
||||
};
|
||||
|
||||
using TextNodetr = std::unique_ptr<TextNode>;
|
Loading…
Add table
Add a link
Reference in a new issue