Fix Painter:viewport()

This works because Painter inherits from ViewRect. Unsure how this went unnoticed.
develop
lethosor 2021-03-27 16:55:17 -04:00
parent d5ba1a3d23
commit 5e09fd882d
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
2 changed files with 2 additions and 1 deletions

@ -34,6 +34,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
# Future
## Lua
- ``gui.Painter``: fixed error when calling ``viewport()`` method
- `xlsxreader`: Added Lua class wrappers for the xlsxreader plugin API
## Documentation

@ -246,7 +246,7 @@ function Painter:isValidPos()
end
function Painter:viewport(x,y,w,h)
local vp = ViewRect.viewport(x,y,w,h)
local vp = ViewRect.viewport(self,x,y,w,h)
vp.cur_pen = self.cur_pen
vp.cur_key_pen = self.cur_key_pen
return mkinstance(Painter, vp):seek(0,0)