fix: negative dx/dy in feOffset (#2515)

# Summary

While working on #2514 I've noticed that negative dx/dy were treated as
positive.

## Test Plan

Add FeOffset filter with negative dx/dy to an element. It should move
closer to upper left corner.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |          |
This commit is contained in:
Jakub Grzywacz
2024-10-28 14:55:22 +01:00
committed by GitHub
parent e6a27f8a3d
commit eb4889c000
@@ -44,8 +44,10 @@ class FeOffsetView extends FilterPrimitiveView {
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;
}