Skip to content

Commit

Permalink
Changed BacklogEntry to make use of DialoguePage::Move()
Browse files Browse the repository at this point in the history
  • Loading branch information
PringlesGang committed Sep 30, 2024
1 parent eb99b77 commit e1205e8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
17 changes: 0 additions & 17 deletions src/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,6 @@ uint8_t ProcessedTextGlyph::Flags() const {
return Profile::Charset::Flags[CharId];
}

void ProcessedTextGlyph::Move(std::vector<ProcessedTextGlyph>& text,
glm::vec2 relativePosition) {
for (ProcessedTextGlyph& chr : text) {
chr.DestRect.X += relativePosition.x;
chr.DestRect.Y += relativePosition.y;
}
}

void ProcessedTextGlyph::MoveTo(std::vector<ProcessedTextGlyph>& text,
glm::vec2 position) {
glm::vec2 curPos =
glm::vec2(text.begin()->DestRect.X, text.begin()->DestRect.Y);
glm::vec2 relativePosition = position - curPos;

Move(text, relativePosition);
}

void TypewriterEffect::Start(int firstGlyph, int glyphCount, float duration) {
DurationIn = duration;
FirstGlyph = firstGlyph;
Expand Down
4 changes: 0 additions & 4 deletions src/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ struct ProcessedTextGlyph {
RectF DestRect;

uint8_t Flags() const;

static void Move(std::vector<ProcessedTextGlyph>& text,
glm::vec2 relativePosition);
static void MoveTo(std::vector<ProcessedTextGlyph>& text, glm::vec2 position);
};

enum DialoguePageMode : uint8_t {
Expand Down
4 changes: 1 addition & 3 deletions src/ui/widgets/backlogentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ void BacklogEntry::UpdateInput() {
void BacklogEntry::Move(glm::vec2 relativePosition) {
Position += relativePosition;
Widget::Move(relativePosition);
ProcessedTextGlyph::Move(BacklogPage->Glyphs, relativePosition);
if (BacklogPage->HasName)
ProcessedTextGlyph::Move(BacklogPage->Name, relativePosition);
BacklogPage->Move(relativePosition);
}

void BacklogEntry::MoveTo(glm::vec2 position) {
Expand Down

0 comments on commit e1205e8

Please sign in to comment.