Simplify naming.

This commit is contained in:
Mikael Sand
2017-07-22 02:13:50 +03:00
parent ec2540a70c
commit bb6ee3e430
3 changed files with 20 additions and 24 deletions
@@ -24,8 +24,8 @@ class Brush {
private BrushType mType = BrushType.LINEAR_GRADIENT;
private final ReadableArray mPoints;
private ReadableArray mColors;
private Matrix mMatrix;
private final boolean mUseObjectBoundingBox;
private Matrix mMatrix;
private Rect mUserSpaceBoundingBox;
Brush(BrushType type, ReadableArray points, BrushUnits units) {
@@ -123,16 +123,16 @@ class GlyphContext {
if (positionX != null) {
mXPositionsIndex++;
mXPositionIndex = -1;
mXs = positionX.trim().split("\\s+");
mXPositionIndices.add(mXPositionIndex);
mXs = positionX.trim().split("\\s+");
mXPositionsContext.add(mXs);
}
if (positionY != null) {
mYPositionsIndex++;
mYPositionIndex = -1;
mYs = positionY.trim().split("\\s+");
mYPositionIndices.add(mYPositionIndex);
mYs = positionY.trim().split("\\s+");
mYPositionsContext.add(mYs);
}
@@ -239,34 +239,30 @@ class GlyphContext {
}
}
PointF getNextGlyphPoint(float glyphWidth) {
setGlyphPositionX();
setGlyphPositionY();
PointF nextPoint(float glyphWidth) {
nextPositionX();
nextPositionY();
mCurrentPosition.x += glyphWidth;
return mCurrentPosition;
}
PointF getNextGlyphDelta() {
setNextDeltaX();
setNextDeltaY();
PointF nextDelta() {
nextDeltaX();
nextDeltaY();
return mCurrentDelta;
}
float getNextGlyphRotation() {
setNextGlyphRotation();
return mRotations[mRotationIndex];
}
private void setNextGlyphRotation() {
float nextRotation() {
for (int index = mRotationsIndex; index >= 0; index--) {
int rotationIndex = mRotationIndices.get(index);
mRotationIndices.set(index, rotationIndex + 1);
}
mRotationIndex = Math.min(mRotationIndex + 1, mRotations.length - 1);
return mRotations[mRotationIndex];
}
private void setNextDeltaX() {
private void nextDeltaX() {
for (int index = mDeltaXsIndex; index >= 0; index--) {
int deltaIndex = mDeltaXIndices.get(index);
mDeltaXIndices.set(index, deltaIndex + 1);
@@ -280,7 +276,7 @@ class GlyphContext {
}
}
private void setNextDeltaY() {
private void nextDeltaY() {
for (int index = mDeltaYsIndex; index >= 0; index--) {
int deltaIndex = mDeltaYIndices.get(index);
mDeltaYIndices.set(index, deltaIndex + 1);
@@ -294,7 +290,7 @@ class GlyphContext {
}
}
private void setGlyphPositionX() {
private void nextPositionX() {
for (int index = mXPositionsIndex; index >= 0; index--) {
int positionIndex = mXPositionIndices.get(index);
mXPositionIndices.set(index, positionIndex + 1);
@@ -309,7 +305,7 @@ class GlyphContext {
}
}
private void setGlyphPositionY() {
private void nextPositionY() {
for (int index = mYPositionsIndex; index >= 0; index--) {
int positionIndex = mYPositionIndices.get(index);
mYPositionIndices.set(index, positionIndex + 1);
@@ -348,7 +344,7 @@ class GlyphContext {
return DEFAULT_FONT_SIZE;
}
ReadableMap getGlyphFont() {
ReadableMap getFont() {
float letterSpacing = DEFAULT_LETTER_SPACING;
float kerning = DEFAULT_KERNING;
@@ -112,7 +112,7 @@ class TSpanShadowNode extends TextShadowNode {
}
GlyphContext gc = getTextRootGlyphContext();
ReadableMap font = gc.getGlyphFont();
ReadableMap font = gc.getFont();
applyTextPropertiesToPaint(paint, font);
float distance = 0;
@@ -160,9 +160,9 @@ class TSpanShadowNode extends TextShadowNode {
previous = current;
}
point = gc.getNextGlyphPoint(width + kerning);
rotation = gc.getNextGlyphRotation();
delta = gc.getNextGlyphDelta();
point = gc.nextPoint(width + kerning);
rotation = gc.nextRotation();
delta = gc.nextDelta();
matrix = new Matrix();
float x = offset + point.x + delta.x - width;