|
@@ -49,8 +49,12 @@ namespace bbiwarg.DataSource
|
|
|
{
|
|
|
float u = uvImage.getU(x, y);
|
|
|
float v = uvImage.getV(x, y);
|
|
|
- int xInColorImage = (int) u * colorImage.getWidth();
|
|
|
- int yInColorImage = (int) v * colorImage.getHeight();
|
|
|
+
|
|
|
+ if (u < 0 || v < 0)
|
|
|
+ return Color.Black;
|
|
|
+
|
|
|
+ int xInColorImage = (int) (u * colorImage.getWidth());
|
|
|
+ int yInColorImage = (int) (v * colorImage.getHeight());
|
|
|
return colorImage.getColor(xInColorImage, yInColorImage);
|
|
|
}
|
|
|
}
|