diff --git a/area_darwin.go b/area_darwin.go index da55b50..50f43a3 100644 --- a/area_darwin.go +++ b/area_darwin.go @@ -55,7 +55,9 @@ var ( func areaView_drawRect(self C.id, rect C.struct_xrect) { s := getSysData(self) // TODO clear clip rect - cliprect := image.Rect(int(rect.x), int(rect.y), int(rect.width), int(rect.height)) + // rectangles in Cocoa are origin/size, not point0/point1; if we don't watch for this, weird things will happen when scrolling + // TODO change names EVERYWHERE ELSE to match + cliprect := image.Rect(int(rect.x), int(rect.y), int(rect.x + rect.width), int(rect.y + rect.height)) max := C.objc_msgSend_stret_rect_noargs(self, _frame) cliprect = image.Rect(0, 0, int(max.width), int(max.height)).Intersect(cliprect) if cliprect.Empty() { // no intersection; nothing to paint