Skip to content

Commit

Permalink
CustomWidget: add missing SetViewportOrgEx call
Browse files Browse the repository at this point in the history
The viewport origin should be adjusted for a partial update, specifically
when updateBounds Rectangle is not at the origin.
  • Loading branch information
tajtiattila authored and lxn committed Dec 5, 2015
1 parent c31f26c commit 43a7f4c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions customwidget.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ func (cw *CustomWidget) bufferedPaint(canvas *Canvas, updateBounds Rectangle) er
}
defer win.SelectObject(buffered.hdc, oldbmp)

win.SetViewportOrgEx(buffered.hdc, -int32(updateBounds.X), -int32(updateBounds.Y), nil)
win.SetBrushOrgEx(buffered.hdc, -int32(updateBounds.X), -int32(updateBounds.Y), nil)

err := cw.paint(&buffered, updateBounds)

if !win.BitBlt(canvas.hdc,
Expand Down

0 comments on commit 43a7f4c

Please sign in to comment.