plotter/hpgl_qt.py

changeset 36
cb4124e3e75b
parent 35
3b7a38af5c42
child 37
e0790756059d
equal deleted inserted replaced
35:3b7a38af5c42 36:cb4124e3e75b
114 mw = br.width() 114 mw = br.width()
115 mh = br.height() 115 mh = br.height()
116 self.qscene.removeItem(t0) 116 self.qscene.removeItem(t0)
117 # don't ask me why theses constants are here, they seem OK, that's all 117 # don't ask me why theses constants are here, they seem OK, that's all
118 t = self.qscene.addSimpleText(s, self.qfont) 118 t = self.qscene.addSimpleText(s, self.qfont)
119 t.scale(1.5 * cw/mw, -2.0 * ch/mh) 119 t.scale(1.1 * cw/mw, -1.6 * ch/mh)
120 x, y = self.pos 120 x, y = self.pos
121 t.moveBy(x,y) 121 t.moveBy(x,y)
122 br = t.boundingRect() 122 br = t.boundingRect()
123 t.moveBy(-0.5*cw, math.sqrt(2)*ch) 123 t.moveBy(-0.5*cw, math.sqrt(2)*ch)
124 124

mercurial