Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
text_cursor too buggy, see desc.
Browse files Browse the repository at this point in the history
- see DEV_NOTE left (line:56 at the moment of writing this message, however it is subject to changes)
  • Loading branch information
projektorius96 committed Nov 2, 2023
1 parent 1ddeb54 commit bb9d9a1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ layer.add(...[/* textNodeDetection, */simpleText]);
stage.add(layer);

/* === Rich text editing right inside canvas (Konva.js) === */
const canvas = layer.getCanvas()._canvas
const canvas = layer.getCanvas()._canvas;
stage.content.addEventListener("click", async function(){

await document.documentElement.requestFullscreen();
Expand All @@ -53,6 +53,19 @@ stage.content.addEventListener("click", async function(){
canvas.focus();
canvas.style.outline = "none";

// DEV_NOTE # text_cursor (ibeam) work very buggy, better find a way to keep blinking a wee cursor-like shape that follows along
// let counter = 0;
/* let text_cursor = new RegExp('\u{1D100}').source; */
// setInterval(()=>{
// if(counter % 2){
// simpleText.setAttr("text", simpleText.text().replace(text_cursor, ""))
// }
// else {
// simpleText.setAttr("text", simpleText.text() + text_cursor)
// }
// counter++;
// }, 750)

})

canvas.addEventListener("keydown", async function(e){
Expand Down

0 comments on commit bb9d9a1

Please sign in to comment.