summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2015-04-15 15:22:42 -0700
committerRaph Levien <raph@google.com>2015-04-15 19:12:48 -0700
commitbb86b433f97a301c11800806b1ce5331fa227d4a (patch)
treed1b23f00979bde438a597fb875afd74fa6f8f847
parentdc7bc6e39e1ef6b713b927baf24db8b4f02f1a3f (diff)
downloadandroid_frameworks_minikin-bb86b433f97a301c11800806b1ce5331fa227d4a.tar.gz
android_frameworks_minikin-bb86b433f97a301c11800806b1ce5331fa227d4a.tar.bz2
android_frameworks_minikin-bb86b433f97a301c11800806b1ce5331fa227d4a.zip
Rename "margins" to "indents"
The name "margin" conflicts with another meaning, so we're making the name in the public api "idents" and the code consistent in naming. Change-Id: I9170116b4d972e4b25f0f319e78376310288eb41
-rw-r--r--include/minikin/LineBreaker.h18
-rw-r--r--libs/minikin/LineBreaker.cpp4
2 files changed, 11 insertions, 11 deletions
diff --git a/include/minikin/LineBreaker.h b/include/minikin/LineBreaker.h
index eb501e7..ebe5dc4 100644
--- a/include/minikin/LineBreaker.h
+++ b/include/minikin/LineBreaker.h
@@ -44,20 +44,20 @@ class LineWidths {
mFirstWidthLineCount = firstWidthLineCount;
mRestWidth = restWidth;
}
- void setMargins(const std::vector<float>& margins) {
- mMargins = margins;
+ void setIndents(const std::vector<float>& indents) {
+ mIndents = indents;
}
bool isConstant() const {
// technically mFirstWidthLineCount == 0 would count too, but doesn't actually happen
- return mRestWidth == mFirstWidth && mMargins.empty();
+ return mRestWidth == mFirstWidth && mIndents.empty();
}
float getLineWidth(int line) const {
float width = (line < mFirstWidthLineCount) ? mFirstWidth : mRestWidth;
- if (!mMargins.empty()) {
- if ((size_t)line < mMargins.size()) {
- width -= mMargins[line];
+ if (!mIndents.empty()) {
+ if ((size_t)line < mIndents.size()) {
+ width -= mIndents[line];
} else {
- width -= mMargins.back();
+ width -= mIndents.back();
}
}
return width;
@@ -66,7 +66,7 @@ class LineWidths {
float mFirstWidth;
int mFirstWidthLineCount;
float mRestWidth;
- std::vector<float> mMargins;
+ std::vector<float> mIndents;
};
class TabStops {
@@ -132,7 +132,7 @@ class LineBreaker {
void setLineWidths(float firstWidth, int firstWidthLineCount, float restWidth);
- void setMargins(const std::vector<float>& margins);
+ void setIndents(const std::vector<float>& indents);
void setTabStops(const int* stops, size_t nStops, int tabWidth) {
mTabStops.set(stops, nStops, tabWidth);
diff --git a/libs/minikin/LineBreaker.cpp b/libs/minikin/LineBreaker.cpp
index 9298f77..f4201cb 100644
--- a/libs/minikin/LineBreaker.cpp
+++ b/libs/minikin/LineBreaker.cpp
@@ -79,8 +79,8 @@ void LineBreaker::setLineWidths(float firstWidth, int firstWidthLineCount, float
}
-void LineBreaker::setMargins(const std::vector<float>& margins) {
- mLineWidths.setMargins(margins);
+void LineBreaker::setIndents(const std::vector<float>& indents) {
+ mLineWidths.setIndents(indents);
}
// This function determines whether a character is a space that disappears at end of line.