Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1075)

Unified Diff: Source/core/layout/svg/SVGTextLayoutEngine.cpp

Issue 1129333004: Inline SVGTextLayoutAttributes::emptyValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/SVGTextLayoutEngine.cpp
diff --git a/Source/core/layout/svg/SVGTextLayoutEngine.cpp b/Source/core/layout/svg/SVGTextLayoutEngine.cpp
index 5931f8f93ddec672e60e09140c1b8676e7687e48..eab2a631a6e15504e399ccd3b760afb0e77346d1 100644
--- a/Source/core/layout/svg/SVGTextLayoutEngine.cpp
+++ b/Source/core/layout/svg/SVGTextLayoutEngine.cpp
@@ -63,10 +63,10 @@ void SVGTextLayoutEngine::updateCharacterPositionIfNeeded(float& x, float& y)
// Replace characters x/y position, with the current text position plus any
// relative adjustments, if it doesn't specify an absolute position itself.
- if (x == SVGTextLayoutAttributes::emptyValue())
+ if (SVGTextLayoutAttributes::isEmptyValue(x))
x = m_x + m_dx;
- if (y == SVGTextLayoutAttributes::emptyValue())
+ if (SVGTextLayoutAttributes::isEmptyValue(y))
y = m_y + m_dy;
m_dx = 0;
@@ -88,12 +88,12 @@ void SVGTextLayoutEngine::updateCurrentTextPosition(float x, float y, float glyp
void SVGTextLayoutEngine::updateRelativePositionAdjustmentsIfNeeded(float dx, float dy)
{
// Update relative positioning information.
- if (dx == SVGTextLayoutAttributes::emptyValue() && dy == SVGTextLayoutAttributes::emptyValue())
+ if (SVGTextLayoutAttributes::isEmptyValue(dx) && SVGTextLayoutAttributes::isEmptyValue(dy))
return;
- if (dx == SVGTextLayoutAttributes::emptyValue())
+ if (SVGTextLayoutAttributes::isEmptyValue(dx))
dx = 0;
- if (dy == SVGTextLayoutAttributes::emptyValue())
+ if (SVGTextLayoutAttributes::isEmptyValue(dy))
dy = 0;
if (m_inPathLayout) {
@@ -485,7 +485,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, cons
if (m_visualCharacterOffset == textBox->start())
textBox->setStartsNewTextChunk(logicalAttributes->context()->characterStartsNewTextChunk(m_logicalCharacterOffset));
- float angle = data.rotate == SVGTextLayoutAttributes::emptyValue() ? 0 : data.rotate;
+ float angle = SVGTextLayoutAttributes::isEmptyValue(data.rotate) ? 0 : data.rotate;
// Calculate glyph orientation angle.
UChar currentCharacter = text.characterAt(m_visualCharacterOffset);
@@ -510,7 +510,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, cons
float scaledGlyphAdvance = glyphAdvance * m_textPathScaling;
if (m_isVerticalText) {
// If there's an absolute y position available, it marks the beginning of a new position along the path.
- if (y != SVGTextLayoutAttributes::emptyValue())
+ if (!SVGTextLayoutAttributes::isEmptyValue(y))
m_textPathCurrentOffset = y + m_textPathStartOffset;
m_textPathCurrentOffset += m_dy;
@@ -521,7 +521,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, cons
yOrientationShift -= scaledGlyphAdvance / 2;
} else {
// If there's an absolute x position available, it marks the beginning of a new position along the path.
- if (x != SVGTextLayoutAttributes::emptyValue())
+ if (!SVGTextLayoutAttributes::isEmptyValue(x))
m_textPathCurrentOffset = x + m_textPathStartOffset;
m_textPathCurrentOffset += m_dx;
« no previous file with comments | « Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698