Lines Matching refs:ctx

64   ctx = canvas.getContext('2d');
68 if(!ctx.setLineDash) {
69 ctx.setLineDash = function(){};
76 ctx.fillStyle = 'rgb(127,127,127)';
77 ctx.beginPath();
78 ctx.moveTo(mx0, my0 + mh0 / 2);
79 ctx.lineTo(mx0 + aw, my0);
80 ctx.lineTo(mx0 + aw, my0 + mh0);
81 ctx.closePath();
82 ctx.fill();
93 ctx.beginPath();
94 ctx.moveTo(mx0 + mw0, my0 + mh0 / 2);
95 ctx.lineTo(mx0 + mw0 - aw, my0);
96 ctx.lineTo(mx0 + mw0 - aw, my0 + mh0);
97 ctx.closePath();
98 ctx.fill();
123 ctx.beginPath();
124 ctx.strokeStyle = 'rgb(192, 192, 77)'; // yellow
125 ctx.font = i18n.t("14px 'Courier'");
126 ctx.strokeText('SketchCanvas Editor v0.1.3', 420, 10);
127 ctx.rect(x0, y0, w0, h0);
128 ctx.rect(x1, y1, w1, h1);
129 ctx.closePath();
130 ctx.stroke();
133 ctx.fillStyle = 'rgb(255,255,255)';
134 ctx.fillRect(x0 + 1, y0 + 1, x1 - 2, y0 + h0 - 2);
137 ctx.fillStyle = 'rgb(0,0,0)';
139 var width = ctx.measureText(text).width;
140 ctx.fillText(text, mx0 + mw0 / 2 - width / 2, my0 + mh0 / 2);
152 ctx.strokeText('X='+x+' Y='+y, x, y);
158 ctx.fillStyle = 'rgb(100, 200, 100)'; // green
159 ctx.fillRect(mx1+(i+0)*(mw1+10), my0, mw1, mh0);
160 //ctx.strokeStyle = 'rgb(50, 192, 177)'; // cyan
161 ctx.strokeStyle = 'rgb(250, 250, 250)'; // white
162 ctx.strokeText(menus[i].text, mx1+10+(i+0)*(mw1+10), my0+20);
174 ctx.fillStyle = 'rgb(255,255,255)';
175 ctx.fillRect(x0 + 1, my0 + mh0 + 1, x1 - 2, my0 + h0 - 2);
179 ctx.fillStyle = 'rgb(255, 80, 77)'; // red
181 ctx.fillStyle = 'rgb(192, 80, 77)'; // red
183 ctx.fillRect(r.minx, r.miny, r.maxx - r.minx, r.maxy - r.miny);
184 ctx.strokeStyle = 'rgb(250, 250, 250)'; // white
199 ctx.beginPath();
200 ctx.fillStyle = colstr[i];
202 ctx.fillRect(x, my0, mw2, mh0);
203 ctx.stroke();
205 ctx.beginPath();
206 //ctx.lineWidth = 1;
207 ctx.strokeStyle = gray;
208 ctx.rect(x, my0, mw2, mh0);
209 ctx.stroke();
212 ctx.beginPath();
213 ctx.strokeStyle = gray;
214 ctx.strokeText('○', x+9, my0+20);
222 ctx.beginPath();
224 ctx.fillStyle = 'rgb(255, 80, 77)'; // red
226 ctx.fillStyle = 'rgb(192, 80, 77)'; // red
227 ctx.fillRect(mx3+(mw2+10)*i, my0, mw2, mh0);
228 ctx.beginPath();
229 ctx.strokeStyle = white;
230 ctx.lineWidth = i + 1;
231 ctx.moveTo(mx3+(mw2+10)*i+10, my0+15);
232 ctx.lineTo(mx3+(mw2+10)*i+25, my0+15);
233 ctx.stroke();
235 ctx.lineWidth = 1;
243 ctx.strokeText(i18n.t('Unimplemented'), x, y);
807 ctx.font = baseSize + "px 'Noto Sans Japanese', sans-serif";
868 ctx.fillStyle = color;
870 ctx.fillRect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
871 ctx.beginPath();
872 ctx.strokeStyle = '#000';
874 ctx.arc((r.minx + r.maxx) / 2., (r.miny + r.maxy) / 2, handleSize, 0, 2 * Math.PI, false);
875 ctx.fill();
878 ctx.rect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
879 ctx.stroke();
890 ctx.save();
891 ctx.beginPath();
892 ctx.rect(x1,y1, w1, h1);
893 ctx.clip();
897 ctx.fillStyle = "#000";
900 ctx.fillRect(ix * gridSize, iy * gridSize, 1, 1);
906 ctx.save();
907 ctx.translate(offset.x, offset.y);
908 ctx.scale(scale, scale);
915 ctx.restore();
918 ctx.beginPath();
919 ctx.lineWidth = 1;
920 ctx.strokeStyle = '#000';
921 ctx.setLineDash([5]);
922 ctx.rect(dragstart[0], dragstart[1], dragend[0] - dragstart[0], dragend[1] - dragstart[1]);
923 ctx.stroke();
924 ctx.setLineDash([]);
931 ctx.restore();
940 ctx.beginPath();
941 ctx.lineWidth = 1;
942 ctx.strokeStyle = '#000';
944 ctx.setLineDash([5]);
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);
948 ctx.stroke();
949 ctx.setLineDash([]);
954 ctx.setLineDash([5]);
955 ctx.beginPath();
956 ctx.moveTo(pt0.x + offset.x, pt0.y + offset.y);
957 ctx.lineTo(pt[name + "x"] + offset.x, pt[name + "y"] + offset.y);
958 ctx.stroke();
959 ctx.setLineDash([]);
1114 var oldfont = ctx.font;
1115 ctx.font = setFont(height);
1116 var width = ctx.measureText(this.text).width;
1117 ctx.font = oldfont;
1384 ctx.fillStyle = '#7f7f7f';
1385 ctx.fillRect(x1,y1, w1, h1);
1387 ctx.fillStyle = white;
1388 ctx.fillRect(x1, y1, Math.min(w1, metaObj.size[0]), Math.min(h1, metaObj.size[1]));
1671 var ctx;
1826 ctx.strokeStyle = color;
1830 ctx.fillStyle = color;
1834 ctx.lineWidth = width;
1918 ctx.beginPath();
1919 ctx.lineWidth = 1;
1920 ctx.strokeStyle = '#000';
1921 ctx.setLineDash([5]);
1922 ctx.rect(bounds.minx, bounds.miny, bounds.maxx-bounds.minx, bounds.maxy-bounds.miny);
1923 ctx.stroke();
1924 ctx.setLineDash([]);
1926 ctx.beginPath();
1927 ctx.strokeStyle = '#000';
1930 ctx.fillStyle = sizing === shape && i === sizedir ? '#7fff7f' : '#ffff7f';
1931 ctx.fillRect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
1932 ctx.rect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
1934 ctx.stroke();
1943 ctx.beginPath();
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);
1951 ctx.closePath();
1952 ctx.stroke();
1953 ctx.strokeText('1', x+45, y+10);
1968 ctx.fillStyle = 'rgb(250, 250, 250)';
1969 ctx.beginPath();
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);
1977 ctx.closePath();
1978 ctx.fill();
1979 ctx.strokeText('1', x+45, y+10);
2011 ctx.beginPath();
2012 ctx.moveTo(x, y);
2013 ctx.lineTo(x+40, y+10);
2014 ctx.stroke();
2015 ctx.strokeText('2', x+45, y+10);
2019 ctx.beginPath();
2020 ctx.moveTo(arr[0].x, arr[0].y);
2021 ctx.lineTo(arr[1].x, arr[1].y);
2022 ctx.stroke();
2023 ctx.lineWidth = 1;
2028 ctx.beginPath();
2029 l_arrow(ctx, [{x:x, y:y+5}, {x:x+40, y:y+5}]);
2030 ctx.strokeText('2', x+45, y+10);
2034 ctx.beginPath();
2035 l_arrow(ctx, arr);
2036 ctx.lineWidth = 1;
2041 ctx.beginPath();
2042 l_tarrow(ctx, [{x:x, y:y+5}, {x:x+40, y:y+5}]);
2043 ctx.strokeText('2', x+45, y+10);
2047 ctx.beginPath();
2048 l_tarrow(ctx, arr);
2049 ctx.lineWidth = 1;
2054 ctx.beginPath();
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);
2062 ctx.stroke();
2063 ctx.strokeText('2', x+45, y+10);
2067 ctx.beginPath();
2068 l_darrow(ctx, arr);
2069 ctx.lineWidth = 1;
2075 ctx.beginPath();
2076 ctx.moveTo(x, y);
2077 ctx.quadraticCurveTo(x+20, y+20, x+40, y);
2078 ctx.stroke();
2079 ctx.strokeText('3', x+45, y+10);
2083 ctx.beginPath();
2084 ctx.moveTo(arr[0].x, arr[0].y);
2085 ctx.quadraticCurveTo(arr[1].x, arr[1].y, arr[2].x, arr[2].y);
2086 ctx.stroke();
2087 ctx.lineWidth = 1;
2093 ctx.beginPath();
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);
2101 ctx.beginPath();
2102 ctx.moveTo(arr[0].x, arr[0].y);
2103 ctx.quadraticCurveTo(arr[1].x, arr[1].y, arr[2].x, arr[2].y);
2104 l_hige(ctx, [arr[1], arr[2]]);
2105 ctx.lineWidth = 1;
2111 ctx.beginPath();
2112 ctx.moveTo(x, y);
2113 ctx.quadraticCurveTo(x+20, y+20, x+40, y);
2115 l_hige(ctx, a);
2118 l_hige(ctx, a);
2119 ctx.strokeText('3', x+45, y+10);
2123 ctx.beginPath();
2124 ctx.moveTo(arr[0].x, arr[0].y);
2125 ctx.quadraticCurveTo(arr[1].x, arr[1].y, arr[2].x, arr[2].y);
2129 l_hige(ctx, a);
2131 l_hige(ctx, a);
2132 ctx.lineWidth = 1;
2137 ctx.beginPath();
2138 ctx.rect(x, y, 40, 10);
2139 ctx.stroke();
2140 ctx.strokeText('2', x+45, y+10);
2144 ctx.beginPath();
2145 ctx.rect(arr[0].x, arr[0].y, arr[1].x-arr[0].x, arr[1].y-arr[0].y);
2146 ctx.stroke();
2147 ctx.lineWidth = 1;
2152 ctx.beginPath();
2153 ctx.scale(1.0, 0.5); // vertically half
2154 ctx.arc(x+20, (y+5)*2, 20, 0, 2 * Math.PI, false);
2155 ctx.stroke();
2156 ctx.scale(1.0, 2.0);
2157 ctx.strokeText('2', x+45, y+10);
2161 ctx.beginPath();
2162 l_elipse(ctx, arr);
2163 ctx.lineWidth = 1;
2168 ctx.beginPath();
2169 ctx.fillStyle = 'rgb(250, 250, 250)';
2170 ctx.fillRect(x, y, 40, 10);
2171 ctx.strokeText('2', x+45, y+10);
2177 ctx.beginPath();
2178 ctx.fillRect(arr[0].x, arr[0].y, arr[1].x-arr[0].x, arr[1].y-arr[0].y);
2182 ctx.beginPath();
2183 ctx.fillStyle = 'rgb(250, 250, 250)';
2184 ctx.scale(1.0, 0.5); // vertically half
2185 ctx.arc(x+20, (y+5)*2, 20, 0, 2 * Math.PI, false);
2186 ctx.fill();
2187 ctx.scale(1.0, 2.0);
2188 ctx.strokeText('2', x+45, y+10);
2194 ctx.beginPath();
2195 l_elipsef(ctx, arr);
2196 ctx.lineWidth = 1;
2201 ctx.beginPath();
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);
2207 ctx.closePath();
2208 ctx.stroke();
2209 ctx.strokeText('1', x+45, y+10);
2213 ctx.beginPath();
2214 //ctx.lineWidth = cur_thin - 40;
2215 l_star(ctx, arr);
2216 ctx.lineWidth = 1;
2221 ctx.beginPath();
2222 ctx.moveTo(x, y);
2223 ctx.lineTo(x+5, y+7);
2224 ctx.lineTo(x+20, y);
2225 ctx.stroke();
2226 ctx.strokeText('1', x+45, y+10);
2231 ctx.beginPath();
2232 l_check(ctx, arr);
2237 ctx.beginPath();
2238 ctx.strokeText(i18n.t('Text'), x+3, y+10);
2239 ctx.strokeText('1', x+45, y+10);
2248 ctx.beginPath();
2252 ctx.fillText(str, obj.points[0].x, obj.points[0].y);
2256 ctx.strokeStyle = '#0000ff';
2257 ctx.beginPath();
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);
2260 ctx.stroke();
2263 ctx.font = setFont(14);
2397 ctx.beginPath();
2398 ctx.moveTo(x, y);
2399 ctx.lineTo(x+10, y+10);
2400 ctx.moveTo(x, y+10);
2401 ctx.lineTo(x+10, y);
2402 ctx.stroke();
2403 ctx.strokeText('1', x+45, y+10);
2408 ctx.beginPath();
2409 ctx.strokeText(i18n.t('Done'), x+3, y+10);
2410 ctx.beginPath();
2411 ctx.arc(x+9, y+5, 8, 0, 6.28, false);
2412 ctx.stroke();
2413 ctx.strokeText('1', x+45, y+10);
2418 ctx.beginPath();
2419 l_complete(ctx, arr);
2425 ctx.beginPath();
2426 ctx.moveTo(x, y);
2427 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2428 ctx.stroke();
2429 ctx.strokeText('n', x+45, y+10);
2435 ctx.beginPath();
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);
2449 ctx.stroke();
2459 ctx.beginPath();
2460 l_hige(ctx, a);
2471 ctx.beginPath();
2472 l_hige(ctx, a);
2474 ctx.lineWidth = 1;
2480 ctx.setLineDash([5]);
2481 ctx.beginPath();
2482 ctx.moveTo(pt0.x, pt0.y);
2483 ctx.lineTo(pt[name + "x"], pt[name + "y"]);
2484 ctx.stroke();
2485 ctx.setLineDash([]);
2591 ctx.beginPath();
2592 ctx.moveTo(x, y);
2593 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2594 ctx.stroke();
2595 l_hige(ctx, [{x: x+20, y: y-10}, {x: x+30, y: y+10}]);
2596 ctx.strokeText('n', x+45, y+10);
2608 ctx.beginPath();
2609 ctx.moveTo(x, y);
2610 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2611 ctx.stroke();
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);