def resetTransforms(self):
"""I want to draw something (eg, string underlines) w.r.t. the default user space.
Reset the matrix! This should be used usually as follows::
canv.saveState()
canv.resetTransforms()
#...draw some stuff in default space coords...
canv.restoreState() # go back!
"""
# we have to adjoin the inverse, since reset is not a basic operation (without save/restore)
(selfa, selfb, selfc, selfd, selfe, selff) = self._currentMatrix
det = selfa*selfd - selfc*selfb
resulta = selfd/det
resultc = -selfc/det
resulte = (selfc*selff - selfd*selfe)/det
resultd = selfa/det
resultb = -selfb/det
resultf = (selfe*selfb - selff*selfa)/det
self.transform(resulta, resultb, resultc, resultd, resulte, resultf)
评论列表
文章目录