mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 10:42:42 +01:00
internal/ui: compute antialias region size correctly. (#2681)
Closes #2679
This commit is contained in:
parent
038cacf97f
commit
2942fa56c1
@ -381,14 +381,16 @@ func (i *bigOffscreenImage) drawTriangles(srcs [graphics.ShaderImageCount]*Image
|
||||
vertices[idx+1] = (vertices[idx+1] - i.region.Y) * bigOffscreenScale
|
||||
}
|
||||
|
||||
// Compute corners in dst coordinate space.
|
||||
x0 := dstRegion.X
|
||||
y0 := dstRegion.Y
|
||||
x1 := dstRegion.X + dstRegion.Width
|
||||
y1 := dstRegion.Y + dstRegion.Height
|
||||
// Translate to i.region coordinate space, and clamp against region size.
|
||||
x0 = max(x0-i.region.X, 0)
|
||||
y0 = max(y0-i.region.Y, 0)
|
||||
x1 = min(x1, i.region.X+i.region.Width)
|
||||
y1 = min(y1, i.region.Y+i.region.Height)
|
||||
x1 = min(x1-i.region.X, i.region.Width)
|
||||
y1 = min(y1-i.region.Y, i.region.Height)
|
||||
dstRegion = graphicsdriver.Region{
|
||||
X: x0 * bigOffscreenScale,
|
||||
Y: y0 * bigOffscreenScale,
|
||||
|
Loading…
Reference in New Issue
Block a user