mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Compare commits
3 Commits
2d07d85330
...
877129ab86
| Author | SHA1 | Date | |
|---|---|---|---|
| 877129ab86 | |||
| 87a6bc2c3f | |||
| 60a3c20732 |
@ -87,7 +87,7 @@ public class Led : Placeable
|
||||
if (RequestedColor.HasValue)
|
||||
RequestedColor = RequestedColor.Value + value;
|
||||
else
|
||||
RequestedColor = value;
|
||||
RequestedColor = _color + value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -43,8 +43,8 @@ public abstract class PixelTexture<T> : ITexture
|
||||
{
|
||||
if (Data.Length == 0) return Color.Transparent;
|
||||
|
||||
int x = (int)MathF.Round(Size.Width * point.X.Clamp(0, 1));
|
||||
int y = (int)MathF.Round(Size.Height * point.Y.Clamp(0, 1));
|
||||
int x = (int)MathF.Round((Size.Width - 1) * point.X.Clamp(0, 1));
|
||||
int y = (int)MathF.Round((Size.Height - 1) * point.Y.Clamp(0, 1));
|
||||
return GetColor(GetPixelData(x, y));
|
||||
}
|
||||
}
|
||||
@ -56,11 +56,14 @@ public abstract class PixelTexture<T> : ITexture
|
||||
{
|
||||
if (Data.Length == 0) return Color.Transparent;
|
||||
|
||||
int x = (int)MathF.Round(Size.Width * rectangle.Location.X.Clamp(0, 1));
|
||||
int y = (int)MathF.Round(Size.Height * rectangle.Location.Y.Clamp(0, 1));
|
||||
int x = (int)MathF.Round((Size.Width - 1) * rectangle.Location.X.Clamp(0, 1));
|
||||
int y = (int)MathF.Round((Size.Height - 1) * rectangle.Location.Y.Clamp(0, 1));
|
||||
int width = (int)MathF.Round(Size.Width * rectangle.Size.Width.Clamp(0, 1));
|
||||
int height = (int)MathF.Round(Size.Height * rectangle.Size.Height.Clamp(0, 1));
|
||||
|
||||
if ((width == 0) && (rectangle.Size.Width > 0)) width = 1;
|
||||
if ((height == 0) && (rectangle.Size.Height > 0)) height = 1;
|
||||
|
||||
return this[x, y, width, height];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user