mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 09:10:44 +00:00
fix: reset paint settings before drawing final bitmap (#2439)
# Summary Fixes #2436. #2403 introduced shared `Paint` between the node render method and the final bitmap. However, Paint properties are not cleared after drawing, so we need to call the `.clear()` method and re-enable antialiasing. ## Compatibility | OS | Implemented | | ------- | :---------: | | Android | ✅ |
This commit is contained in:
@@ -136,6 +136,9 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC
|
|||||||
mBitmap = drawOutput();
|
mBitmap = drawOutput();
|
||||||
}
|
}
|
||||||
if (mBitmap != null) {
|
if (mBitmap != null) {
|
||||||
|
mPaint.reset();
|
||||||
|
mPaint.setFlags(Paint.ANTI_ALIAS_FLAG | Paint.DEV_KERN_TEXT_FLAG | Paint.SUBPIXEL_TEXT_FLAG);
|
||||||
|
mPaint.setTypeface(Typeface.DEFAULT);
|
||||||
if (mScaleX != 1 || mScaleY != 1) {
|
if (mScaleX != 1 || mScaleY != 1) {
|
||||||
canvas.drawBitmap(
|
canvas.drawBitmap(
|
||||||
mBitmap,
|
mBitmap,
|
||||||
|
|||||||
Reference in New Issue
Block a user