canvas.go
func SetClipRect(x, y, w, h int) {
	if x < 0 {
		x = 0
	}
	if y < 0 {
		y = 0
	}
	if x+w > canvas.width {
		w = canvas.width - x
	}
	if y+h > canvas.height {
		h = canvas.height - h
	}

	canvas.clipX = x
	canvas.clipY = y
	canvas.clipW = w
	canvas.clipH = h
}
func SetClipRect(x, y, w, h int) {
	if x < 0 {
		x = 0
	}
	if y < 0 {
		y = 0
	}
	if x+w > canvas.width {
		w = canvas.width - x
	}
	if y+h > canvas.height {
		h = canvas.height - h
	}

	canvas.clipX = x
	canvas.clipY = y
	canvas.clipW = w
	canvas.clipH = h
}
func SetClipRect ( x , y , w , h int ) { if x < 0 { x = 0 } if y < 0 { y = 0 } if x + w > canvas . width { w = canvas . width - x } if y + h > canvas . height { h = canvas . height - h } canvas . clipX = x canvas . clipY = y canvas . clipW = w canvas . clipH = h }
// SetClipRect defines a new clipping rect. Maybe useful with PopClip and
// PushClip functions
SetClipRect defines a new clipping rect . Maybe useful with PopClip and PushClip functions