//Exits the current viewport, unless there is no viewport. func (me *Canvas) PopViewport() { if me.viewport.pt != 0 { me.origin.SubtractFrom(me.viewport.translate()) me.viewport.pop() r := me.viewport.bounds() if r.Width == -1 { r.Width = p.DisplayWidth() } if r.Height == -1 { r.Height = p.DisplayHeight() } p.SetClipRect(r.X, r.Y, r.Width, r.Height) me.origin = me.translation.AddOf(me.viewport.bounds().Point) me.origin.AddTo(me.viewport.translate()) } }
//Returns the height of the display window. func DisplayHeight() int { return p.DisplayHeight() }