Skip to content

Commit

Permalink
fix: don't move out textRanges
Browse files Browse the repository at this point in the history
  • Loading branch information
hjanetzek committed Jul 25, 2016
1 parent a3ea0a0 commit e4db674
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions core/src/style/textStyleBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ std::unique_ptr<StyledMesh> TextStyleBuilder::build() {
auto* textLabel = static_cast<TextLabel*>(label.get());

std::vector<TextRange>& ranges = textLabel->textRanges();
if (ranges.empty()) {
// FIXME when does this happen?
continue;
}

bool active = textLabel->state() != Label::State::dead;

Expand Down Expand Up @@ -110,10 +106,6 @@ std::unique_ptr<StyledMesh> TextStyleBuilder::build() {
if (!active) { continue; }

std::vector<TextRange>& ranges = textLabel->textRanges();
if (ranges.empty()) {
// FIXME when does this happen?
continue;
}

// Add the quads of line-labels only once
if (ranges.back().range.end() != quadPos) {
Expand Down Expand Up @@ -521,13 +513,10 @@ bool TextStyleBuilder::prepareLabel(TextStyle::Parameters& _params, Label::Type
void TextStyleBuilder::addLabel(const TextStyle::Parameters& _params, Label::Type _type,
Label::Transform _transform) {

// int quadsStart = m_attributes.quadsStart;
// int quadsCount = m_quads.size() - quadsStart;

m_labels.emplace_back(new TextLabel(_transform, _type, _params.labelOptions,
{m_attributes.fill, m_attributes.stroke, m_attributes.fontScale},
{m_attributes.width, m_attributes.height},
*m_textLabels, std::move(m_attributes.textRanges),
*m_textLabels, m_attributes.textRanges,
_params.align));
}

Expand Down

0 comments on commit e4db674

Please sign in to comment.