(self, gc, x, y, s, prop, angle, ismath=False, mtext=None)
| 224 | gc.unselect() |
| 225 | |
| 226 | def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None): |
| 227 | # docstring inherited |
| 228 | |
| 229 | if ismath: |
| 230 | s = cbook.strip_math(s) |
| 231 | _log.debug("%s - draw_text()", type(self)) |
| 232 | gc.select() |
| 233 | self.handle_clip_rectangle(gc) |
| 234 | gfx_ctx = gc.gfx_ctx |
| 235 | |
| 236 | font = self.get_wx_font(s, prop) |
| 237 | color = gc.get_wxcolour(gc.get_rgb()) |
| 238 | gfx_ctx.SetFont(font, color) |
| 239 | |
| 240 | w, h, d = self.get_text_width_height_descent(s, prop, ismath) |
| 241 | x = int(x) |
| 242 | y = int(y - h) |
| 243 | |
| 244 | if angle == 0.0: |
| 245 | gfx_ctx.DrawText(s, x, y) |
| 246 | else: |
| 247 | rads = math.radians(angle) |
| 248 | xo = h * math.sin(rads) |
| 249 | yo = h * math.cos(rads) |
| 250 | gfx_ctx.DrawRotatedText(s, x - xo, y - yo, rads) |
| 251 | |
| 252 | gc.unselect() |
| 253 | |
| 254 | def new_gc(self): |
| 255 | # docstring inherited |
nothing calls this directly
no test coverage detected