Skip to content

Commit

Permalink
Merge pull request #229 from react-native-community/percentage-props-…
Browse files Browse the repository at this point in the history
…refactor-ios

Fix #228
  • Loading branch information
magicismight authored Jan 15, 2017
2 parents c47190b + 7c42772 commit 381753f
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 419 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,8 @@ public void draw(Canvas canvas, Paint paint, float opacity) {
opacity *= mOpacity;

if (opacity > MIN_OPACITY_FOR_DRAW) {
if (mPath == null) {
mPath = getPath(canvas, paint);
mPath.setFillType(mFillRule);
}
mPath = getPath(canvas, paint);
mPath.setFillType(mFillRule);

clip(canvas, paint);
if (setupFillPaint(paint, opacity * mFillOpacity, null)) {
Expand Down
2 changes: 0 additions & 2 deletions android/src/main/java/com/horcrux/svg/SvgViewShadowNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ public Rect getCanvasBounds() {
}

private void drawChildren(Canvas canvas) {
canvas.getClipBounds();
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
Paint paint = new Paint();

for (int i = 0; i < getChildCount(); i++) {
Expand Down
4 changes: 0 additions & 4 deletions android/src/main/java/com/horcrux/svg/TSpanShadowNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ protected Path getPath(Canvas canvas, Paint paint) {
private Path getLinePath(String line, Paint paint, Path path) {
float[] widths = new float[line.length()];
paint.getTextWidths(line, widths);

float glyphPosition = 0f;

for (int index = 0; index < line.length(); index++) {
Expand Down Expand Up @@ -133,9 +132,6 @@ private Path getLinePath(String line, Paint paint, Path path) {
return path;
}

@TargetApi(Build.VERSION_CODES.JELLY_BEAN)


private void applyTextPropertiesToPaint(Paint paint) {
ReadableMap font = getFontFromContext();

Expand Down
Loading

0 comments on commit 381753f

Please sign in to comment.