diff options
author | Xavier Ducrohet <xav@android.com> | 2010-12-06 11:08:37 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-12-06 11:12:47 -0800 |
commit | b5ddf041d61f9346a4055b5bc5d51bd812b2ec28 (patch) | |
tree | 92248c4af035e582636ec5ee32b90eb22b06231b /tools | |
parent | 26e30bb7fe373ad4bb569a5de2577e0c857e7c27 (diff) | |
download | frameworks_base-b5ddf041d61f9346a4055b5bc5d51bd812b2ec28.zip frameworks_base-b5ddf041d61f9346a4055b5bc5d51bd812b2ec28.tar.gz frameworks_base-b5ddf041d61f9346a4055b5bc5d51bd812b2ec28.tar.bz2 |
LayoutLib: Update font object when text info changes in paint delegate
Change-Id: I6ff7e1ec4513918256aee99acc5ea298a5fdb8a8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java index 93f757a..c09f8ad 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java @@ -340,6 +340,7 @@ public class Paint_Delegate { } delegate.mTextSize = textSize; + delegate.updateFontObject(); } /*package*/ static float getTextScaleX(Paint thisPaint) { @@ -362,6 +363,7 @@ public class Paint_Delegate { } delegate.mTextScaleX = scaleX; + delegate.updateFontObject(); } /*package*/ static float getTextSkewX(Paint thisPaint) { @@ -384,6 +386,7 @@ public class Paint_Delegate { } delegate.mTextSkewX = skewX; + delegate.updateFontObject(); } /*package*/ static float ascent(Paint thisPaint) { @@ -662,7 +665,9 @@ public class Paint_Delegate { return 0; } - return delegate.mTypeface = typeface; + delegate.mTypeface = typeface; + delegate.updateFontObject(); + return delegate.mTypeface; } /*package*/ static int native_setRasterizer(int native_object, int rasterizer) { @@ -670,7 +675,6 @@ public class Paint_Delegate { throw new UnsupportedOperationException(); } - /*package*/ static int native_getTextAlign(int native_object) { // get the delegate from the native int. Paint_Delegate delegate = sManager.getDelegate(native_object); @@ -810,14 +814,10 @@ public class Paint_Delegate { private Paint_Delegate() { reset(); - - mTypeface = Typeface.sDefaults[0].native_instance; - updateFontObject(); } private Paint_Delegate(Paint_Delegate paint) { set(paint); - updateFontObject(); } private void set(Paint_Delegate paint) { @@ -838,6 +838,7 @@ public class Paint_Delegate { mShader = paint.mShader; mPathEffect = paint.mPathEffect; mMaskFilter = paint.mMaskFilter; + updateFontObject(); } private void reset() { @@ -847,7 +848,7 @@ public class Paint_Delegate { mCap = 0; mJoin = 0; mTextAlign = 0; - mTypeface = 0; + mTypeface = Typeface.sDefaults[0].native_instance; mStrokeWidth = 1.f; mStrokeMiter = 2.f; mTextSize = 20.f; @@ -858,6 +859,7 @@ public class Paint_Delegate { mShader = 0; mPathEffect = 0; mMaskFilter = 0; + updateFontObject(); } /** |