Skip to content

Commit 0d1ae55

Browse files
committed
kirilllive
1 parent 2f04cfb commit 0d1ae55

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

.DS_Store

0 Bytes
Binary file not shown.

ascii_paint.html

100644100755
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
#boosty{fill:var(--tx);}
278278
</style>
279279
</head>
280-
<body onload="new_canvas(60,30);">
280+
<body onload="new_canvas(60,30);" style="overflow:hidden;">
281281
<canvas id="preview" style="display:none;"></canvas>
282282
<a id="get_file" style="display:none;position:fixed;"></a>
283283
<input id="file" type="file" style="display:none;position:fixed;"/>
@@ -536,13 +536,14 @@
536536
context_menu.style.top=(e.clientY+asciiscreen.scrollTop-doc.top)/scale+"px";
537537
}
538538
window.addEventListener('mousemove',function(e){if(tool==5){cursor_text.style.left=(e.clientX+16)+"px";cursor_text.style.top=(e.clientY+16)+"px";}})
539-
window.addEventListener('mousedown',function(){if(tool==0||tool==3||tool==5){mouseclick=true;};if(contextmenushow){contextmenushow=false;context_menu.style.visibility='hidden';mouseclick=false;}})
539+
window.addEventListener('mousedown',function(e){if(e.button==0){if(tool==0||tool==3||tool==5){mouseclick=true;};if(contextmenushow){contextmenushow=false;context_menu.style.visibility='hidden';mouseclick=false;}} })
540540
window.addEventListener('mouseup',function(){mouseclick=false;cursor_text.style.display="none"})
541541
window.addEventListener('keypress',function(e){var n=String.fromCharCode(e.charCode);brush=n;active_brush.innerHTML=brush;})
542542
asciicanvas.addEventListener('mouseup',function(){if(tool!=2&&tool!=5){state_save()};})
543543
var startmove_x=null,startmove_y=null,scroll_x=null,scroll_y=null;
544544
viewport.addEventListener('mousedown',function(e){
545-
if(tool==2){
545+
if(tool==2||e.button==1){
546+
if(e.button==1){e.preventDefault();}
546547
startmove_x=e.clientX;startmove_y=e.clientY;scroll_x=viewport.scrollTop;scroll_y=viewport.scrollLeft;
547548
viewport.onmousemove=function(e){viewport.scrollTop=scroll_x-(e.clientY-startmove_y);viewport.scrollLeft=scroll_y-(e.clientX-startmove_x);};
548549
viewport.onmouseup=function (e){startmove_x=null;startmove_y=null;viewport.onmousemove=null;viewport.onmouseup=null;};
@@ -675,7 +676,7 @@
675676
for(x=0;x<w;x++){
676677
td=document.createElement("td");
677678
td.setAttribute("onmouseenter","if(event.which!=3&&!contextmenushow){targetcell=["+x+","+y+"];cur_x.innerHTML="+(x+1)+";cur_y.innerHTML="+(y+1)+";if(mouseclick){if(tool==5){selected[2]="+x+";selected[3]="+y+";select_arr();}else if(tool==0){this.innerHTML=brush;}else if(tool==3){this.innerHTML=' ';}}}")
678-
td.setAttribute("onmousedown","if(event.which!=3&&!contextmenushow){if(tool==5){selected=["+x+","+y+","+x+","+y+"];select_arr();}else if(tool==0){this.innerHTML=brush;}else if(tool==3){this.innerHTML=' ';}else if(tool==1){start_fill("+x+","+y+",this.textContent);}else if(tool==4){brush=this.textContent;active_brush.innerHTML=brush;}}")
679+
td.setAttribute("onmousedown","if(event.button==0&&event.which!=3&&!contextmenushow){if(tool==5){selected=["+x+","+y+","+x+","+y+"];select_arr();}else if(tool==0){this.innerHTML=brush;}else if(tool==3){this.innerHTML=' ';}else if(tool==1){start_fill("+x+","+y+",this.textContent);}else if(tool==4){brush=this.textContent;active_brush.innerHTML=brush;}}")
679680
td.setAttribute("oncontextmenu","targetcell=["+x+","+y+"]")
680681
if(se&&(x1<=x&&x<=x2)&&(y1<=y&&y<=y2)){td.style.backgroundColor="var(--cw)"}
681682
if(db[y][x]&&db[y][x]!=" "){td.innerHTML=db[y][x]}else{td.innerHTML=" "}

examples/logo_a.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
_ ___ ___ ___ ___
2+
/_\ / __|/ __|_ _|_ _|
3+
/ _ \\__ \ (__ | | | |
4+
/_/ \_\___/\___|___|___| ,d$b
5+
__ ___ ,d$$P'
6+
/\ |__) | ,d$$$'
7+
/~~\ | \ | ,d,//\)
8+
__ ___ _d P),\\(\
9+
|__) /\ | |\ | | ,.)\)\\_(((\)
10+
| /~~\ | | \| | d$$`\`._,)))))
11+
d$$$P' `.__/(((:
12+
___,,---''\ d$$P' \ (`:
13+
___,,---'' \_/'\P' ) ..
14+
\ __ ,---,_ | _/' / ))
15+
\ ,-" `\\ \ `)/`\ | //
16+
\ | \ )`-`\_-'"'\ \ | //
17+
\ `--'`\/ `\ ) \ \ \\
18+
\ `\ `,_\-' \ `.\\
19+
\ \_,' \ /_}}
20+
\ ___,,---''
21+
\___,,---''
22+

examples/lum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
22

33
█████ ████
44
██████░░██████████

0 commit comments

Comments
 (0)