Skip to content

Commit

Permalink
fix: negative dx/dy in feOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
jakex7 committed Oct 28, 2024
1 parent e6a27f8 commit 91b4e64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion android/src/main/java/com/horcrux/svg/FeOffsetView.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public Bitmap applyFilter(HashMap<String, Bitmap> resultsMap, Bitmap prevResult)
float dy = this.mDy != null ? (float) this.relativeOnHeight(this.mDy) : 0;
RectF frame = new RectF(0, 0, dx, dy);
this.getSvgView().getCtm().mapRect(frame);
dx = frame.left < 0 ? frame.left : frame.width();
dy = frame.top < 0 ? frame.top : frame.height();

canvas.drawBitmap(source, frame.width(), frame.height(), null);
canvas.drawBitmap(source, dx, dy, null);

return result;
}
Expand Down

0 comments on commit 91b4e64

Please sign in to comment.