Skip to content

Commit ec0f2aa

Browse files
committed
Add text parameters
1 parent d1dcf74 commit ec0f2aa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ipycanvas/canvas.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class Canvas(DOMWidget):
3232
global_alpha = Float(1.0)
3333

3434
font = Unicode('12px serif')
35+
textAlign = Unicode('start')
36+
textBaseline = Unicode('alphabetic')
37+
direction = Unicode('inherit')
3538

3639
def __init__(self, *args, **kwargs):
3740
self.caching = kwargs.get('caching', False)
@@ -113,7 +116,7 @@ def flush(self):
113116
self.caching = False
114117
self._commands_cache = []
115118

116-
@observe('fill_style', 'stroke_style', 'global_alpha')
119+
@observe('fill_style', 'stroke_style', 'global_alpha', 'font', 'textAlign', 'textBaseline', 'direction')
117120
def _on_set_attr(self, change):
118121
command = {
119122
'name': 'set',

0 commit comments

Comments
 (0)