Lines Matching +full:cood +full:- +full:e

22 import jsyaml from './js-yaml.mjs';
54 // Ignore mouse events if it's non-edit mode.
89 toolbarPage = Math.max(toolbarPage - 1, 0);
96 buttons.push(new Button(mx0 + mw0 - aw, my0, mx0 + mw0, my0 + mh0, function(){
99 ctx.lineTo(mx0 + mw0 - aw, my0);
100 ctx.lineTo(mx0 + mw0 - aw, my0 + mh0);
105 toolbarPage = Math.min(toolbarPage + 1, toolbars.length-1);
138 ctx.fillRect(x0 + 1, y0 + 1, x1 - 2, y0 + h0 - 2);
144 ctx.fillText(text, mx0 + mw0 / 2 - width / 2, my0 + mh0 / 2);
179 ctx.fillRect(x0 + 1, my0 + mh0 + 1, x1 - 2, my0 + h0 - 2);
187 ctx.fillRect(r.minx, r.miny, r.maxx - r.minx, r.maxy - r.miny);
264 return {minx: r.minx - offset, miny : r.miny - offset,
278 function mouseLeftClick(e) { argument
279 if (3 == e.which) mouseRightClick(e);
282 var mx = e.clientX - clrect.left;
283 var my = e.clientY - clrect.top;
334 cur_col = colnames[menuno-31];
345 cur_thin = menuno - 40;
358 function mouseRightClick(e) { argument
359 //drawPos(e.pageX, e.pageY);
360 //cood = { x:e.pageX, y:e.pageY }
361 //arr[idx] = cood;
376 function pathEditMouseDown(e){ argument
378 var mx = e.clientX - clrect.left;
379 var my = e.clientY - clrect.top;
385 // Do not try to change shape of non-sizeable object.
396 if(!hitRect(pointHandle(p.x, p.y), mx - offset.x, my - offset.y))
401 if(selectobj[n].tool === "path" && e.ctrlKey){
438 if("cx" in p && "cy" in p && hitRect(pointHandle(p.cx, p.cy), mx - offset.x, my - offset.y)){
445 if("dx" in p && "dy" in p && hitRect(pointHandle(p.dx, p.dy), mx - offset.x, my - offset.y)){
487 toolmap.pathedit.selectPointIdx = -1;
496 function selectMouseDown(e){ argument
498 var mx = e.clientX - clrect.left;
499 var my = e.clientY - clrect.top;
506 // Enter sizing, moving or box-selecting mode only with select tool.
511 // Do not try to change size of non-sizeable object.
516 if(1 <= Math.abs(bounds.maxx - bounds.minx) && 1 <= Math.abs(bounds.maxy - bounds.miny)){
546 function mouseDown(e){ argument
548 cur_tool.mouseDown(e);
551 function mouseUp(e){ argument
553 cur_tool.mouseUp(e);
556 function selectMouseMove(e){ argument
558 var mx = (gridEnable ? Math.round(e.clientX / gridSize) * gridSize : e.clientX) - clrect.left;
559 var my = (gridEnable ? Math.round(e.clientY / gridSize) * gridSize : e.clientY) - clrect.top;
563 var dx = mx - movebase[0];
564 var dy = my - movebase[1];
583 0 --- 1 --- 2
587 6 --- 5 --- 4
589 mx -= offset.x;
590 my -= offset.y;
592 var ux = [-1,0,1,1,1,0,-1,-1][sizedir];
593 var uy = [-1,-1,-1,0,1,1,1,0][sizedir];
594 …var xscale = ux === 0 ? 1 : (ux === 1 ? mx - bounds.minx : bounds.maxx - mx) / (bounds.maxx - boun…
595 …var yscale = uy === 0 ? 1 : (uy === 1 ? my - bounds.miny : bounds.maxy - my) / (bounds.maxy - boun…
607 (pt[prop] - bounds.minx) * xscale + bounds.minx :
608 (pt[prop] - bounds.maxx) * xscale + bounds.maxx;
619 (pt[prop] - bounds.miny) * yscale + bounds.miny :
620 (pt[prop] - bounds.maxy) * yscale + bounds.maxy;
633 // We could use e.buttons to check if it's supported by all the browsers,
654 function pathEditMouseMove(e){ argument
656 var mx = (gridEnable ? Math.round(e.clientX / gridSize) * gridSize : e.clientX) - clrect.left;
657 var my = (gridEnable ? Math.round(e.clientY / gridSize) * gridSize : e.clientY) - clrect.top;
661 mx -= offset.x;
662 my -= offset.y;
677 var dx = mx - pointMoving.points[pointMovingIdx].x;
678 var dy = my - pointMoving.points[pointMovingIdx].y;
694 // makes the connected Bezier curves look smooth. This could be done by hand-editing,
700 // Sometimes the user wants to make a non-smooth path, so this functionality can be
702 if(!e.altKey && pointMovingCP === "d" && pointMovingIdx + 1 < pointMoving.points.length){
705 var dx = nextpoint.cx - curpoint.x;
706 var dy = nextpoint.cy - curpoint.y;
709 var newangle = Math.atan2(curpoint.y - curpoint.dy, curpoint.x - curpoint.dx);
714 else if(!e.altKey && pointMovingCP === "c" && 0 <= pointMovingIdx - 1){
715 var prevpoint = pointMoving.points[pointMovingIdx - 1];
717 var dx = prevpoint.dx - prevpoint.x;
718 var dy = prevpoint.dy - prevpoint.y;
721 var newangle = Math.atan2(prevpoint.y - curpoint.cy, prevpoint.x - curpoint.cx);
732 function mouseMove(e){ argument
734 cur_tool.mouseMove(e);
737 function mouseleave(e){ argument
745 function viewModeClick(e){ argument
747 var mx = (gridEnable ? Math.round(e.clientX / gridSize) * gridSize : e.clientX) - clrect.left;
748 var my = (gridEnable ? Math.round(e.clientY / gridSize) * gridSize : e.clientY) - clrect.top;
757 if(dobjs[i].viewModeClick(e))
764 function keyDown(e){ argument
765 e = e || window.event;
767 cur_tool.keyDown(e);
806 return { x: (coord.x - offset.x) / scale, y: (coord.y - offset.y) / scale };
811 ctx.font = baseSize + "px 'Noto Sans Japanese', sans-serif";
842 /// Returns a small rectangle surrounding the given point which is suitable for mouse-picking.
844 return {minx: x - handleSize, miny: y - handleSize, maxx: x + handleSize, maxy: y + handleSize};
874 ctx.fillRect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
882 ctx.rect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
926 ctx.rect(dragstart[0], dragstart[1], dragend[0] - dragstart[0], dragend[1] - dragstart[1]);
979 drawGuidingLine(pts[i-1], "c");
1043 pt.dx = parseFloat(pt2[pt2.length-4]);
1044 pt.dy = parseFloat(pt2[pt2.length-3]);
1046 pt.x = parseFloat(pt2[pt2.length-2]);
1047 pt.y = parseFloat(pt2[pt2.length-1]);
1122 return {minx: this.points[0].x, miny: this.points[0].y - height,
1127 TextShape.prototype.viewModeClick = function(e){ argument
1142 /// Custom serializer for SVG-compatible path data
1154 src += this.points[i-1].x+","+this.points[i-1].y+" ";
1174 /// Custom deserializer for SVG-compatible path data
1197 pt.dx = parseFloat(pt2[pt2.length-4]);
1198 pt.dy = parseFloat(pt2[pt2.length-3]);
1200 pt.x = parseFloat(pt2[pt2.length-2]);
1201 pt.y = parseFloat(pt2[pt2.length-1]);
1251 } catch(e){
1252 console.log(e);
1284 } catch(e){
1285 debug(e);
1307 catch(e){
1308 console.log(e);
1346 catch(e){
1347 debug(e);
1375 catch(e){
1376 console.log(e);
1412 if (x > w0 || y > h0) no = -1;
1418 if (y < my0 || y > my0+mh0) return -1;
1423 return -1;
1446 if (y < my0 || y > my0+mh0) return -1;
1451 return -1;
1455 if (y < my0 || y > my0+mh0) return -1;
1460 return -1;
1491 // https://github/com/es-shims/es5-shim/blob/v2.0.5/es5-shim.js
1534 // this 'new' is important in case obj is user-defined class which was created by
1536 // I wonder why Array and Object (built-in classes) don't need new operator.
1550 } catch(e){
1551 console.log(e);
1567 dobjs = dhistory[dhistory.length-1];
1595 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1621 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1642 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1647 //------------------------ debug ------------------------
1672 // init --------------------------------------------------
1687 new MenuItem("Grid-", function(){
1744 // Cross-browser scroll position query
1763 /// support set type and js-yaml library converts YAML's !!set type
1776 /// a set-like object, while set2seq does the opposite.
1869 // but single-point shapes will finish with just single click.
1878 Tool.prototype.mouseDown = function(e){ argument
1882 Tool.prototype.mouseMove = function(e){ argument
1885 var mx = (gridEnable ? Math.round(e.clientX / gridSize) * gridSize : e.clientX) - clrect.left;
1886 var my = (gridEnable ? Math.round(e.clientY / gridSize) * gridSize : e.clientY) - clrect.top;
1889 cur_shape.points[cur_shape.points.length-1] = canvasToSrc(constrainCoord(coord));
1894 Tool.prototype.mouseUp = function(e){ argument
1904 Tool.prototype.keyDown = function(e){ argument
1905 var code = e.keyCode || e.which;
1926 ctx.rect(bounds.minx, bounds.miny, bounds.maxx-bounds.minx, bounds.maxy-bounds.miny);
1935 ctx.fillRect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
1936 ctx.rect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
1948 ctx.moveTo(x, y-5);
1961 mouseUp: function(e){ argument
1964 Tool.prototype.mouseUp.call(this, e); argument
1974 ctx.moveTo(x, y-5);
1987 mouseUp: function(e){ argument
1990 Tool.prototype.mouseUp.call(this, e); argument
1992 keyDown: function(e){ argument
1993 var code = e.keyCode || e.which;
2011 selectPointIdx: -1, // Default value for the variable
2149 ctx.rect(arr[0].x, arr[0].y, arr[1].x-arr[0].x, arr[1].y-arr[0].y);
2182 ctx.fillRect(arr[0].x, arr[0].y, arr[1].x-arr[0].x, arr[1].y-arr[0].y);
2206 ctx.moveTo(x+8, y-3);
2218 //ctx.lineWidth = cur_thin - 40;
2295 lay.textInput.onkeyup = function(e){ argument
2297 if(e.keyCode === 13)
2316 okbutton.onclick = function(e){
2374 …textLayer.linkInput.style.width = textInputRect.width - (linkInputRect.left - textInputRect.left) …
2377 // Cross-browser scroll position query
2431 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2449 ctx.bezierCurveTo(arr[i-1].x, arr[i-1].y, arr[i].dx, arr[i].dy, arr[i].x, arr[i].y);
2467 var last = arr[arr.length-1], last2 = arr[arr.length-2], a = [];
2493 var last = arr[arr.length-1];
2496 var next = {x: 2 * last.x - last.dx, y: 2 * last.y - last.dy};
2522 var prev = pts[pts.length-2];
2534 var prev = pts[pts.length-1];
2537 d.cx = 2 * prev.x - prev.dx;
2538 d.cy = 2 * prev.y - prev.dy;
2544 mouseDown: function(e){ argument
2547 var mx = e.clientX - clrect.left;
2548 var my = e.clientY - clrect.top;
2553 this.lastPoint = cur_shape.points[cur_shape.points.length-1];
2556 mouseMove: function(e){ argument
2560 var mx = e.clientX - clrect.left;
2561 var my = e.clientY - clrect.top;
2566 var prev = cur_shape.points[cur_shape.points.length-2];
2568 pt.dx = 2 * pt.x - d.x;
2569 pt.dy = 2 * pt.y - d.y;
2576 var pt = cur_shape.points[cur_shape.points.length-1];
2577 var dx = coord.x - pt.x;
2578 var dy = coord.y - pt.y;
2588 mouseUp: function(e){ argument
2597 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2599 l_hige(ctx, [{x: x+20, y: y-10}, {x: x+30, y: y+10}]);
2614 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2617 l_hige(ctx, [{x: x+20, y: y-10}, {x: x+30, y: y+10}]);
2657 var defaultMetaObj = {type: "meta", size: [1024-x1, 640-y1]};
2664 // A pseudo-this pointer that can be used in private methods.
2673 // Create and return a XMLHttpRequest object or ActiveXObject for IE6-
2680 catch(e){
2685 catch(e){
2689 catch(e){