module timelinelib.canvas.drawing.drawers.ballondrawer¶
-
timelinelib.canvas.drawing.drawers.ballondrawer.
BALLOON_RADIUS
= 12¶
-
timelinelib.canvas.drawing.drawers.ballondrawer.
ARROW_OFFSET
= 37¶
-
timelinelib.canvas.drawing.drawers.ballondrawer.
MIN_TEXT_WIDTH
= 200¶
-
timelinelib.canvas.drawing.drawers.ballondrawer.
SLIDER_WIDTH
= 20¶
-
class
timelinelib.canvas.drawing.drawers.ballondrawer.
BallonDrawer
[source]¶ Bases:
object
-
__init__
(dc, scene, appearance, event)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
draw_balloon_bg
(inner_size, tip_pos, above, sticky)[source]¶ Draw the balloon background leaving inner_size for content.
tip_pos determines where the tip of the ballon should be.
above determines if the balloon should be above the tip (True) or below (False). This is not currently implemented.
W
- |----------------|
______________ _
/ | R = Corner Radius
| | AA = Left Arrow-leg angleW_ARROW | | H MARGIN = Text margin|--| | | * = Starting point ____ ______/ _ / / | /_/ | H_ARROW * -|----| ARROW_OFFSET
Calculation of points starts at the tip of the arrow and continues clockwise around the ballon.
Return (bounding_rect, x, y) where x and y is at top of inner region.
-
-
timelinelib.canvas.drawing.drawers.ballondrawer.
break_text
(text, dc, max_width_in_px)[source]¶ Break the text into lines so that they fits within the given width.
-
timelinelib.canvas.drawing.drawers.ballondrawer.
break_sentence
(dc, lines, sentence, max_width_in_px)[source]¶ Break a sentence into lines.
-
timelinelib.canvas.drawing.drawers.ballondrawer.
break_line
(dc, sentence, max_word_len_in_ch)[source]¶ Break a sentence into words.