Example #1
0
//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())
	}
}
Example #2
0
//Returns the width of the display window.
func DisplayWidth() int {
	return p.DisplayWidth()
}