Konva
ステージ
キャンバスのスクロール
キャンバスのズーム
既存オブジェクトからステージオブジェクトの参照を取得する
code:js
group.on('mouseenter', (e) => {
e.target.getStage().container().style.cursor = 'move'
})
線
ベジェ
オブジェクト連結線
Nodeイベント
mouseover, mousemove, mouseout, mouseenter, mouseleave, mousedown, mouseup, wheel, contextmenu, click, dblclick, touchstart, touchmove, touchend, tap, dbltap, dragstart, dragmove, and dragend events.
ドラッグアンドドロップ
code:js
<... @dragmove="handleRectChange" />
handleRectChange(e) {
console.log(e.target.x(), e.target.y()); // will log current position
},
ステージにファイルドロップ
Selectorによるオブジェクト参照の取得
ドット始まりは name による探索
findAncestor, findAncestors もある
ERROR
Cannot read properties of undefined (reading 'getParent')
おそらくタイポが原因。属性名のミスや、行末にセミコロンが入っていたりしませんか。
PNG/PDF出力
PDF出力といってもPNG画像を埋め込んでいるだけ。キャンバスの大前提として、canvasタグで描画している画像を扱うものだと思われる。それもあって、ステージからはみ出たものは出力できないはず。