-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ShadowMatrix does not implement map* methods #3602
Milestone
Comments
Hey, would you be open to sending a pull request?
…On Dec 14, 2017 9:18 AM, "Lean Rada" ***@***.***> wrote:
Description
ShadowMatrix does not implement mapPoints and mapVectors methods.
Steps to Reproduce
// in a Robolectric testMatrix matrix = new Matrix();
matrix.setTranslate(1, 2);
float[] test = new float[] { 0, 0 };
matrix.mapPoints(test); // nothing happens here
assert test[0] == 1;assert test[1] == 2;
Robolectric & Android Version
robolectric: 3.5.1
android: 26
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3602>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AGBaeH90EaF8nrXI0iZUXrBN-Em6Yy1Oks5tAVhYgaJpZM4RCZPc>
.
|
Possibly! I've written a quick fix for my project just now. @Implements(Matrix.class)
public class ShadowMatrix extends org.robolectric.shadows.ShadowMatrix {
@Implementation
public void mapPoints(float[] dst, int dstIndex, float[] src, int srcIndex, int pointCount) {
for (int i = 0; i < pointCount; i++) {
PointF mapped = mapPoint(src[srcIndex + i * 2], src[srcIndex + i * 2 + 1]);
dst[dstIndex + i * 2] = mapped.x;
dst[dstIndex + i * 2 + 1] = mapped.y;
}
}
} But, for the |
Hi, I'm working on a fix. Will make a pull request later. 😄 Update: #3609 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
ShadowMatrix
does not implementmapPoints
andmapVectors
methods.Steps to Reproduce
Robolectric & Android Version
robolectric: 3.5.1
android: 26
The text was updated successfully, but these errors were encountered: