graphics: Use an even number for screen height offset

Fixes #622
This commit is contained in:
Hajime Hoshi 2018-08-12 19:26:38 +09:00
parent 610bf6e39f
commit a82201cfe8

View File

@ -122,7 +122,8 @@ func (c *graphicsContext) Update(afterFrameUpdate func()) error {
// c.screen is special: its Y axis is down to up, // c.screen is special: its Y axis is down to up,
// and the origin point is lower left. // and the origin point is lower left.
op.GeoM.Scale(c.screenScale, -c.screenScale) op.GeoM.Scale(c.screenScale, -c.screenScale)
op.GeoM.Translate(0, float64(dh)) // Make dh an even number to fit the upper side of the screen (#662).
op.GeoM.Translate(0, float64((dh+1)/2*2))
op.GeoM.Translate(c.offsetX, c.offsetY) op.GeoM.Translate(c.offsetX, c.offsetY)
op.CompositeMode = CompositeModeCopy op.CompositeMode = CompositeModeCopy