Search code examples
konvajs

How do I get Konva's canvas to go from right to left


I want to display some Hebrew text using Text and TextPath. In plain HTML5 it seems the best way is to set the dir attribute on the canvas to rtl (HTML5 Canvas fillText with Right-to-Left string). How do I do that in Konva?


Solution

  • const canvas = layer.getCanvas()._canvas;
    
    canvas.setAttribute('dir', 'rtl');
    

    http://jsbin.com/wezusafebi/edit?js,output