Рет қаралды 12
S1E2 for Season 1 Episode 2
========================
This demo depicts matrix transformation (particularly rotation about origin) using Konva.Shape that taps into user-agent's native CanvasRenderingContext2D (context), which in turn allows not only to use each feature of Konva.js itself, but also enables developer to leverage context.setTransform or context.transform (personally, in this demo I use setTransform to be as much state-independent as possible) to get the desired result of custom matrix transformation. Most importantly, this rotation is totally Konva.js utility methods free, i.e. no specific Konva.js methods such as rotate or rotation used, so matrix transformation is completely pure in that sense. The matrix rotation is achieved via combination of scaling and skewing, and quite frankly, I found this technique quite surprising myself !
========================
This is just a recorder demo, however source code is planned to be available publicly some time in the future, so stay tuned for more !