Lines Matching refs:x

151 function drawPos(x, y) {
152 ctx.strokeText('X='+x+' Y='+y, x, y);
201 var x = mx2+(mw2+10)*i;
202 ctx.fillRect(x, my0, mw2, mh0);
208 ctx.rect(x, my0, mw2, mh0);
214 ctx.strokeText('○', x+9, my0+20);
239 function drawParts(tool, x, y) {
241 tool.drawTool(x, y);
243 ctx.strokeText(i18n.t('Unimplemented'), x, y);
250 ret.minx += offset.x;
251 ret.maxx += offset.x;
265 function hitRect(r, x, y){
266 return r.minx < x && x < r.maxx && r.miny < y && y < r.maxy;
294 if(mx < offset.x || my < offset.y)
350 //if (1 == menuno) debug('x='+arr[0].x + 'y='+arr[0].y);
356 //cood = { x:e.pageX, y:e.pageY }
392 if(!hitRect(pointHandle(p.x, p.y), mx - offset.x, my - offset.y))
434 if("cx" in p && "cy" in p && hitRect(pointHandle(p.cx, p.cy), mx - offset.x, my - offset.y)){
441 if("dx" in p && "dy" in p && hitRect(pointHandle(p.dx, p.dy), mx - offset.x, my - offset.y)){
499 if(mx < offset.x || my < offset.y)
565 pt.x += dx;
585 mx -= offset.x;
597 var props = ["x", "cx", "dx"];
657 mx -= offset.x;
665 if((name + "x") in p1) p1[name + "x"] += dx;
673 var dx = mx - pointMoving.points[pointMovingIdx].x;
675 pointMoving.points[pointMovingIdx].x = mx;
684 curpoint[pointMovingCP + "x"] = mx;
701 var dx = nextpoint.cx - curpoint.x;
705 var newangle = Math.atan2(curpoint.y - curpoint.dy, curpoint.x - curpoint.dx);
706 nextpoint.cx = curpoint.x + len * Math.cos(newangle);
713 var dx = prevpoint.dx - prevpoint.x;
717 var newangle = Math.atan2(prevpoint.y - curpoint.cy, prevpoint.x - curpoint.cx);
718 prevpoint.dx = prevpoint.x + len * Math.cos(newangle);
745 var m = {x: mx / scale, y: my / scale}; /// Convert to the logical coordinate system before hit test
752 if(hitRect(bounds, m.x, m.y)){
794 return { x: Math.round(coord.x / gridSize) * gridSize, y: Math.round(coord.y / gridSize) * gridSize };
796 return { x: coord.x, y: coord.y };
802 return { x: (coord.x - offset.x) / scale, y: (coord.y - offset.y) / scale };
823 var x, y;
825 case 0: x = bounds.minx, y = bounds.miny; break;
826 case 1: x = (bounds.minx+bounds.maxx)/2, y = bounds.miny; break;
827 case 2: x = bounds.maxx, y = bounds.miny; break;
828 case 3: x = bounds.maxx, y = (bounds.miny+bounds.maxy)/2; break;
829 case 4: x = bounds.maxx, y = bounds.maxy; break;
830 case 5: x = (bounds.minx+bounds.maxx)/2, y = bounds.maxy; break;
831 case 6: x = bounds.minx, y = bounds.maxy; break;
832 case 7: x = bounds.minx, y = (bounds.miny+bounds.maxy)/2; break;
835 return pointHandle(x, y);
839 function pointHandle(x, y){
840 return {minx: x - handleSize, miny: y - handleSize, maxx: x + handleSize, maxy: y + handleSize};
854 offset = {x:0, y:0};
861 offset = {x:x1, y:y1};
866 function drawHandle(x, y, color, circle){
867 var r = pointHandle(x, y);
907 ctx.translate(offset.x, offset.y);
945 ctx.moveTo(pts[0].x + offset.x, pts[0].y + offset.y);
947 ctx.lineTo(pts[i].x + offset.x, pts[i].y + offset.y);
956 ctx.moveTo(pt0.x + offset.x, pt0.y + offset.y);
957 ctx.lineTo(pt[name + "x"] + offset.x, pt[name + "y"] + offset.y);
965 drawHandle(pt.x + offset.x, pt.y + offset.y,
974 drawHandle(pt.cx + offset.x, pt.cy + offset.y, '#ff7f7f', true);
978 drawHandle(pt.dx + offset.x, pt.dy + offset.y, '#ff7f7f', true);
1008 dat += this.points[i].x+","+this.points[i].y;
1042 pt.x = parseFloat(pt2[pt2.length-2]);
1054 var x = this.points[j].x;
1055 if(maxx === undefined || maxx < x)
1056 maxx = x;
1057 if(minx === undefined || x < minx)
1058 minx = x;
1082 return {minx: this.points[0].x, miny: this.points[0].y,
1083 maxx: this.points[0].x + width, maxy: this.points[0].y + height};
1118 return {minx: this.points[0].x, miny: this.points[0].y - height,
1119 maxx: this.points[0].x + width, maxy: this.points[0].y};
1150 src += this.points[i-1].x+","+this.points[i-1].y+" ";
1154 src += pt.x+","+pt.y+" ";
1160 src += pt.x+","+pt.y;
1196 pt.x = parseFloat(pt2[pt2.length-2]);
1400 function checkMenu(x, y) {
1401 var no = choiceMenu(x, y);
1403 no = choiceCBox(x, y);
1405 no = choiceHBox(x, y);
1408 if (x > w0 || y > h0) no = -1;
1412 function choiceMenu(x, y) {
1416 if (x >= mx1+(mw1+10)*i && x <= mx1+mw0+(mw1+10)*i) return i;
1423 function choiceTBox(x, y) {
1425 if (x < mx0 || x > mx0+mw0) return false;
1428 if(hitRect(r, x, y)){
1441 function choiceCBox(x, y) {
1444 if (x >= mx2+(mw2+10)*i && x <= mx2+mw2+(mw2+10)*i) return i+31;
1450 function choiceHBox(x, y) {
1453 if (x >= mx3+(mw2+10)*i && x <= mx3+mw2+(mw2+10)*i) return i+41;
1591 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1617 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1638 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1714 + 'x:<input id="sizeinputx" type="text">'
1809 /// drawTool: A function(x, y) to draw icon on the toolbar.
1842 Tool.prototype.appendPoint = function(x, y) {
1843 function addPoint(x, y){
1853 cur_shape.points.push(canvasToSrc(constrainCoord({x:x, y:y})));
1866 if(!addPoint(x, y))
1867 addPoint(x, y);
1870 addPoint(x, y);
1884 var coord = {x: mx, y: my};
1942 new Tool("select", 1, {drawTool: function(x, y){
1944 ctx.moveTo(x, y-5);
1945 ctx.lineTo(x, y+10);
1946 ctx.lineTo(x+4, y+7);
1947 ctx.lineTo(x+6, y+11);
1948 ctx.lineTo(x+8, y+9);
1949 ctx.lineTo(x+6, y+5);
1950 ctx.lineTo(x+10, y+3);
1953 ctx.strokeText('1', x+45, y+10);
1967 drawTool: function(x, y){
1970 ctx.moveTo(x, y-5);
1971 ctx.lineTo(x, y+10);
1972 ctx.lineTo(x+4, y+7);
1973 ctx.lineTo(x+6, y+11);
1974 ctx.lineTo(x+8, y+9);
1975 ctx.lineTo(x+6, y+5);
1976 ctx.lineTo(x+10, y+3);
1979 ctx.strokeText('1', x+45, y+10);
2010 drawTool: function(x, y){
2012 ctx.moveTo(x, y);
2013 ctx.lineTo(x+40, y+10);
2015 ctx.strokeText('2', x+45, y+10);
2020 ctx.moveTo(arr[0].x, arr[0].y);
2021 ctx.lineTo(arr[1].x, arr[1].y);
2027 drawTool: function(x, y){
2029 l_arrow(ctx, [{x:x, y:y+5}, {x:x+40, y:y+5}]);
2030 ctx.strokeText('2', x+45, y+10);
2040 drawTool: function(x, y){
2042 l_tarrow(ctx, [{x:x, y:y+5}, {x:x+40, y:y+5}]);
2043 ctx.strokeText('2', x+45, y+10);
2053 drawTool: function(x, y){
2055 ctx.moveTo(x, y+3);
2056 ctx.lineTo(x+39, y+3);
2057 ctx.moveTo(x, y+7);
2058 ctx.lineTo(x+39, y+7);
2059 ctx.moveTo(x+35, y);
2060 ctx.lineTo(x+40, y+5);
2061 ctx.lineTo(x+35, y+10);
2063 ctx.strokeText('2', x+45, y+10);
2074 drawTool: function(x, y){
2076 ctx.moveTo(x, y);
2077 ctx.quadraticCurveTo(x+20, y+20, x+40, y);
2079 ctx.strokeText('3', x+45, y+10);
2084 ctx.moveTo(arr[0].x, arr[0].y);
2085 ctx.quadraticCurveTo(arr[1].x, arr[1].y, arr[2].x, arr[2].y);
2092 drawTool: function(x, y){
2094 ctx.moveTo(x, y);
2095 ctx.quadraticCurveTo(x+20, y+20, x+40, y);
2096 l_hige(ctx, [{x:x+20, y:y+20}, {x:x+40, y:y}]);
2097 ctx.strokeText('3', x+45, y+10);
2102 ctx.moveTo(arr[0].x, arr[0].y);
2103 ctx.quadraticCurveTo(arr[1].x, arr[1].y, arr[2].x, arr[2].y);
2110 drawTool: function(x, y){
2112 ctx.moveTo(x, y);
2113 ctx.quadraticCurveTo(x+20, y+20, x+40, y);
2114 var a = [{x:x+20, y:y+20}, {x:x+40, y:y}];
2116 //a[0] = {x:x+10, y:y+10};
2117 a[1] = {x:x, y:y};
2119 ctx.strokeText('3', x+45, y+10);
2124 ctx.moveTo(arr[0].x, arr[0].y);
2125 ctx.quadraticCurveTo(arr[1].x, arr[1].y, arr[2].x, arr[2].y);
2136 drawTool: function(x, y){
2138 ctx.rect(x, y, 40, 10);
2140 ctx.strokeText('2', x+45, y+10);
2145 ctx.rect(arr[0].x, arr[0].y, arr[1].x-arr[0].x, arr[1].y-arr[0].y);
2151 drawTool: function(x, y){
2154 ctx.arc(x+20, (y+5)*2, 20, 0, 2 * Math.PI, false);
2157 ctx.strokeText('2', x+45, y+10);
2167 drawTool: function(x, y){
2170 ctx.fillRect(x, y, 40, 10);
2171 ctx.strokeText('2', x+45, y+10);
2178 ctx.fillRect(arr[0].x, arr[0].y, arr[1].x-arr[0].x, arr[1].y-arr[0].y);
2181 new Tool("ellipsefill", 2, {drawTool: function(x, y){
2185 ctx.arc(x+20, (y+5)*2, 20, 0, 2 * Math.PI, false);
2188 ctx.strokeText('2', x+45, y+10);
2200 drawTool: function(x, y){
2202 ctx.moveTo(x+8, y-3);
2203 ctx.lineTo(x+14, y+13);
2204 ctx.lineTo(x, y+2);
2205 ctx.lineTo(x+16, y+2);
2206 ctx.lineTo(x+2, y+13);
2209 ctx.strokeText('1', x+45, y+10);
2220 drawTool: function(x, y){
2222 ctx.moveTo(x, y);
2223 ctx.lineTo(x+5, y+7);
2224 ctx.lineTo(x+20, y);
2226 ctx.strokeText('1', x+45, y+10);
2236 drawTool: function(x, y){
2238 ctx.strokeText(i18n.t('Text'), x+3, y+10);
2239 ctx.strokeText('1', x+45, y+10);
2252 ctx.fillText(str, obj.points[0].x, obj.points[0].y);
2258 ctx.moveTo(obj.points[0].x, obj.points[0].y + 4);
2259 ctx.lineTo(obj.points[0].x + ctx.measureText(str).width, obj.points[0].y + 4);
2265 appendPoint: function(x, y){
2273 textLayer.canvasPos = {x:0, y:0};
2328 obj.points.push({x: lay.canvasPos.x, y: lay.canvasPos.y});
2351 var coord = canvasToSrc(constrainCoord({x:x, y:y}));
2352 textLayer.canvasPos.x = coord.x;
2359 if(dobjs[i] instanceof TextShape && hitRect(objBounds(dobjs[i], true), coord.x, coord.y)){
2378 textLayer.style.left = (canvasRect.left + scrollX + offset.x + coord.x) + 'px';
2396 drawTool: function(x, y){
2398 ctx.moveTo(x, y);
2399 ctx.lineTo(x+10, y+10);
2400 ctx.moveTo(x, y+10);
2401 ctx.lineTo(x+10, y);
2403 ctx.strokeText('1', x+45, y+10);
2407 drawTool: function(x, y){
2409 ctx.strokeText(i18n.t('Done'), x+3, y+10);
2411 ctx.arc(x+9, y+5, 8, 0, 6.28, false);
2413 ctx.strokeText('1', x+45, y+10);
2424 drawTool: function(x, y){
2426 ctx.moveTo(x, y);
2427 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2429 ctx.strokeText('n', x+45, y+10);
2436 ctx.moveTo(arr[0].x, arr[0].y);
2440 ctx.bezierCurveTo(arr[i].cx, arr[i].cy, arr[i].dx, arr[i].dy, arr[i].x, arr[i].y);
2442 ctx.bezierCurveTo(arr[i].cx, arr[i].cy, arr[i].x, arr[i].y, arr[i].x, arr[i].y);
2445 ctx.bezierCurveTo(arr[i-1].x, arr[i-1].y, arr[i].dx, arr[i].dy, arr[i].x, arr[i].y);
2447 ctx.lineTo(arr[i].x, arr[i].y);
2452 if("cx" in first2 && "cy" in first2 && (first2.cx !== first.x || first2.cy !== first.y))
2453 a[0] = {x: first2.cx, y: first2.cy};
2454 else if("dx" in first2 && "dy" in first2 && (first2.dx !== first.x || first2.dy !== first.y))
2455 a[0] = {x: first2.dx, y: first2.dy};
2464 if("dx" in last && "dy" in last && (last.dx !== last.x || last.dy !== last.y))
2465 a[0] = {x: last.dx, y: last.dy};
2466 else if("cx" in last && "cy" in last && (last.cx !== last.x || last.cy !== last.y))
2467 a[0] = {x: last.cx, y: last.cy};
2482 ctx.moveTo(pt0.x, pt0.y);
2483 ctx.lineTo(pt[name + "x"], pt[name + "y"]);
2492 var next = {x: 2 * last.x - last.dx, y: 2 * last.y - last.dy};
2494 drawHandle(next.x, next.y, "#ff7f7f", true);
2498 appendPoint: function(x, y){
2504 var d = canvasToSrc(constrainCoord({x:x, y:y}));
2519 if(d.x === prev.x && d.y === prev.y){
2533 d.cx = 2 * prev.x - prev.dx;
2560 var d = canvasToSrc(constrainCoord({x:mx, y:my}));
2561 if(0 < cur_shape.points.length && (pt.x !== d.x && pt.y !== d.y)){
2564 pt.dx = 2 * pt.x - d.x;
2571 var coord = canvasToSrc(constrainCoord({x: mx, y: my}));
2573 var dx = coord.x - pt.x;
2575 pt.x = coord.x;
2577 // Only move dx and dy along with x, y.
2590 drawTool: function(x, y){
2592 ctx.moveTo(x, y);
2593 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2595 l_hige(ctx, [{x: x+20, y: y-10}, {x: x+30, y: y+10}]);
2596 ctx.strokeText('n', x+45, y+10);
2607 drawTool: function(x, y){
2609 ctx.moveTo(x, y);
2610 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2612 l_hige(ctx, [{x: x+10, y: y+20}, {x: x, y: y}]);
2613 l_hige(ctx, [{x: x+20, y: y-10}, {x: x+30, y: y+10}]);
2614 ctx.strokeText('n', x+45, y+10);
2642 var offset = editmode ? {x:x1, y:y1} : {x:0, y:0};