Voeg 28 herkenbare kleurplaten en creatieve niveaus toe (v0.4.66-beta) #4
3 changed files with 25 additions and 6 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
0.3.73-beta
|
||||
0.3.74-beta
|
||||
|
|
|
|||
|
|
@ -566,6 +566,19 @@ function makeMovable(t){
|
|||
t.addEventListener("pointerdown", e=>{
|
||||
if(e.target.classList.contains("dtool-x") || e.target.closest(".dtool-opts")) return;
|
||||
e.preventDefault(); e.stopPropagation();
|
||||
/* pen actief en neergezet op de randzone van de lat: tekenen gaat vóór
|
||||
verslepen - zoals je een echte liniaal vasthoudt terwijl je erlangs
|
||||
tekent. Alleen een greep verder van de rand verplaatst het gereedschap. */
|
||||
if(!e.target.classList.contains("dtool-rot")
|
||||
&& document.body.classList.contains("pen")
|
||||
&& ["pen","vulp","mark"].includes(PEN.tool)
|
||||
&& (t.classList.contains("dtool-ruler") || t.classList.contains("dtool-geo"))){
|
||||
const r = bInk.getBoundingClientRect();
|
||||
const px = (e.clientX - r.left) * (board.clientWidth / r.width);
|
||||
const py = (e.clientY - r.top) * (board.clientHeight / r.height);
|
||||
const hit = nearestEdge(px, py);
|
||||
if(hit && hit.d <= 24){ startInkStroke(e); return; }
|
||||
}
|
||||
if(e.target.classList.contains("dtool-rot")){
|
||||
const r = t.getBoundingClientRect();
|
||||
const cx = r.left+r.width/2, cy = r.top+r.height/2;
|
||||
|
|
@ -936,9 +949,10 @@ function snapPoint(x, y){
|
|||
if(Math.hypot(px-qx, py-qy) > 60){ bSnap = null; return [x, y]; }
|
||||
return [qx*k, qy*k];
|
||||
}
|
||||
bInk.addEventListener("pointerdown", e=>{
|
||||
if(e.pointerType==="mouse" && e.button!==0) return;
|
||||
e.preventDefault();
|
||||
/* start van een haal; ook aanroepbaar vanaf de liniaal/geodriehoek zelf
|
||||
(pen op de randzone van de lat = tekenen, niet verslepen) - de pointer
|
||||
capture op bInk stuurt de vervolg-events vanzelf hierheen */
|
||||
function startInkStroke(e){
|
||||
if(PEN.tool==="text"){ startBoardText(e); return; }
|
||||
bInk.setPointerCapture(e.pointerId);
|
||||
bDraw = true;
|
||||
|
|
@ -948,11 +962,16 @@ bInk.addEventListener("pointerdown", e=>{
|
|||
if(PEN.tool!=="erase" && PEN.tool!=="hand"){
|
||||
const k = bInk.width / board.clientWidth;
|
||||
const hit = nearestEdge(bx/k, by/k);
|
||||
if(hit && hit.d <= 16) bSnap = hit;
|
||||
if(hit && hit.d <= 24) bSnap = hit;
|
||||
}
|
||||
[bx,by] = snapPoint(bx, by);
|
||||
bMidX = bMidY = null;
|
||||
bStroke(bx+0.01, by+0.01, e.pressure, e.pointerType);
|
||||
}
|
||||
bInk.addEventListener("pointerdown", e=>{
|
||||
if(e.pointerType==="mouse" && e.button!==0) return;
|
||||
e.preventDefault();
|
||||
startInkStroke(e);
|
||||
});
|
||||
bInk.addEventListener("pointermove", e=>{
|
||||
if(!bDraw) return;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"use strict";
|
||||
/* version — shown until /api/version resolves (or if the fetch fails, e.g. offline).
|
||||
Kept in sync by hand with the VERSION file at the repo root on every release. */
|
||||
const VERSION = "0.3.73-beta";
|
||||
const VERSION = "0.3.74-beta";
|
||||
(function(){
|
||||
const tag = document.getElementById("verTag");
|
||||
tag.textContent = "v"+VERSION;
|
||||
|
|
|
|||
Loading…
Reference in a new issue