You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
make android.text.Layout.draw() compatible custom Canvas classes
TextAndroidCanvas is a proxy canvas class which prevents us from accessing the GtkSnapshot of the real canvas. To solve this problem, we call Canvas.drawText() for each line.
This commit is contained in:
@@ -136,6 +136,11 @@ public class GskCanvas extends Canvas {
|
||||
native_concat(snapshot, matrix.native_instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawText(CharSequence text, int start, int end, float x, float y, Paint paint) {
|
||||
drawText(text.toString().substring(start, end), x, y, paint);
|
||||
}
|
||||
|
||||
protected native void native_drawBitmap(long snapshot, long texture, int x, int y, int width, int height, long paint);
|
||||
protected native void native_drawRect(long snapshot, float left, float top, float right, float bottom, long paint);
|
||||
protected native void native_drawPath(long snapshot, long path, long paint);
|
||||
|
||||
Reference in New Issue
Block a user