Lines Matching refs:ctx

68   ctx = canvas.getContext('2d');
72 if(!ctx.setLineDash) {
73 ctx.setLineDash = function(){};
80 ctx.fillStyle = 'rgb(127,127,127)';
81 ctx.beginPath();
82 ctx.moveTo(mx0, my0 + mh0 / 2);
83 ctx.lineTo(mx0 + aw, my0);
84 ctx.lineTo(mx0 + aw, my0 + mh0);
85 ctx.closePath();
86 ctx.fill();
97 ctx.beginPath();
98 ctx.moveTo(mx0 + mw0, my0 + mh0 / 2);
99 ctx.lineTo(mx0 + mw0 - aw, my0);
100 ctx.lineTo(mx0 + mw0 - aw, my0 + mh0);
101 ctx.closePath();
102 ctx.fill();
127 ctx.beginPath();
128 ctx.strokeStyle = 'rgb(192, 192, 77)'; // yellow
129 ctx.font = i18n.t("14px 'Courier'");
130 ctx.strokeText('SketchCanvas Editor v0.1.6', 420, 10);
131 ctx.rect(x0, y0, w0, h0);
132 ctx.rect(x1, y1, w1, h1);
133 ctx.closePath();
134 ctx.stroke();
137 ctx.fillStyle = 'rgb(255,255,255)';
138 ctx.fillRect(x0 + 1, y0 + 1, x1 - 2, y0 + h0 - 2);
141 ctx.fillStyle = 'rgb(0,0,0)';
143 var width = ctx.measureText(text).width;
144 ctx.fillText(text, mx0 + mw0 / 2 - width / 2, my0 + mh0 / 2);
156 ctx.strokeText('X='+x+' Y='+y, x, y);
162 ctx.fillStyle = 'rgb(100, 200, 100)'; // green
163 ctx.fillRect(mx1+(i+0)*(mw1+10), my0, mw1, mh0);
165 ctx.strokeStyle = 'rgb(250, 250, 250)'; // white
166 ctx.strokeText(menus[i].text, mx1+10+(i+0)*(mw1+10), my0+20);
178 ctx.fillStyle = 'rgb(255,255,255)';
179 ctx.fillRect(x0 + 1, my0 + mh0 + 1, x1 - 2, my0 + h0 - 2);
183 ctx.fillStyle = 'rgb(255, 80, 77)'; // red
185 ctx.fillStyle = 'rgb(192, 80, 77)'; // red
187 ctx.fillRect(r.minx, r.miny, r.maxx - r.minx, r.maxy - r.miny);
188 ctx.strokeStyle = 'rgb(250, 250, 250)'; // white
203 ctx.beginPath();
204 ctx.fillStyle = colstr[i];
206 ctx.fillRect(x, my0, mw2, mh0);
207 ctx.stroke();
209 ctx.beginPath();
211 ctx.strokeStyle = gray;
212 ctx.rect(x, my0, mw2, mh0);
213 ctx.stroke();
216 ctx.beginPath();
217 ctx.strokeStyle = gray;
218 ctx.strokeText('○', x+9, my0+20);
226 ctx.beginPath();
228 ctx.fillStyle = 'rgb(255, 80, 77)'; // red
230 ctx.fillStyle = 'rgb(192, 80, 77)'; // red
231 ctx.fillRect(mx3+(mw2+10)*i, my0, mw2, mh0);
232 ctx.beginPath();
233 ctx.strokeStyle = white;
234 ctx.lineWidth = i + 1;
235 ctx.moveTo(mx3+(mw2+10)*i+10, my0+15);
236 ctx.lineTo(mx3+(mw2+10)*i+25, my0+15);
237 ctx.stroke();
239 ctx.lineWidth = 1;
247 ctx.strokeText(i18n.t('Unimplemented'), x, y);
811 ctx.font = baseSize + "px 'Noto Sans Japanese', sans-serif";
872 ctx.fillStyle = color;
874 ctx.fillRect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
875 ctx.beginPath();
876 ctx.strokeStyle = '#000';
878 ctx.arc((r.minx + r.maxx) / 2., (r.miny + r.maxy) / 2, handleSize, 0, 2 * Math.PI, false);
879 ctx.fill();
882 ctx.rect(r.minx, r.miny, r.maxx - r.minx, r.maxy-r.miny);
883 ctx.stroke();
894 ctx.save();
895 ctx.beginPath();
896 ctx.rect(x1,y1, w1, h1);
897 ctx.clip();
901 ctx.fillStyle = "#000";
904 ctx.fillRect(ix * gridSize, iy * gridSize, 1, 1);
910 ctx.save();
911 ctx.translate(offset.x, offset.y);
912 ctx.scale(scale, scale);
919 ctx.restore();
922 ctx.beginPath();
923 ctx.lineWidth = 1;
924 ctx.strokeStyle = '#000';
925 ctx.setLineDash([5]);
926 ctx.rect(dragstart[0], dragstart[1], dragend[0] - dragstart[0], dragend[1] - dragstart[1]);
927 ctx.stroke();
928 ctx.setLineDash([]);
935 ctx.restore();
944 ctx.beginPath();
945 ctx.lineWidth = 1;
946 ctx.strokeStyle = '#000';
948 ctx.setLineDash([5]);
949 ctx.moveTo(pts[0].x + offset.x, pts[0].y + offset.y);
951 ctx.lineTo(pts[i].x + offset.x, pts[i].y + offset.y);
952 ctx.stroke();
953 ctx.setLineDash([]);
958 ctx.setLineDash([5]);
959 ctx.beginPath();
960 ctx.moveTo(pt0.x + offset.x, pt0.y + offset.y);
961 ctx.lineTo(pt[name + "x"] + offset.x, pt[name + "y"] + offset.y);
962 ctx.stroke();
963 ctx.setLineDash([]);
1118 var oldfont = ctx.font;
1119 ctx.font = setFont(height);
1120 var width = ctx.measureText(this.text).width;
1121 ctx.font = oldfont;
1388 ctx.fillStyle = '#7f7f7f';
1389 ctx.fillRect(x1,y1, w1, h1);
1391 ctx.fillStyle = white;
1392 ctx.fillRect(x1, y1, Math.min(w1, metaObj.size[0]), Math.min(h1, metaObj.size[1]));
1675 var ctx;
1830 ctx.strokeStyle = color;
1834 ctx.fillStyle = color;
1838 ctx.lineWidth = width;
1922 ctx.beginPath();
1923 ctx.lineWidth = 1;
1924 ctx.strokeStyle = '#000';
1925 ctx.setLineDash([5]);
1926 ctx.rect(bounds.minx, bounds.miny, bounds.maxx-bounds.minx, bounds.maxy-bounds.miny);
1927 ctx.stroke();
1928 ctx.setLineDash([]);
1930 ctx.beginPath();
1931 ctx.strokeStyle = '#000';
1934 ctx.fillStyle = sizing === shape && i === sizedir ? '#7fff7f' : '#ffff7f';
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);
1938 ctx.stroke();
1947 ctx.beginPath();
1948 ctx.moveTo(x, y-5);
1949 ctx.lineTo(x, y+10);
1950 ctx.lineTo(x+4, y+7);
1951 ctx.lineTo(x+6, y+11);
1952 ctx.lineTo(x+8, y+9);
1953 ctx.lineTo(x+6, y+5);
1954 ctx.lineTo(x+10, y+3);
1955 ctx.closePath();
1956 ctx.stroke();
1957 ctx.strokeText('1', x+45, y+10);
1972 ctx.fillStyle = 'rgb(250, 250, 250)';
1973 ctx.beginPath();
1974 ctx.moveTo(x, y-5);
1975 ctx.lineTo(x, y+10);
1976 ctx.lineTo(x+4, y+7);
1977 ctx.lineTo(x+6, y+11);
1978 ctx.lineTo(x+8, y+9);
1979 ctx.lineTo(x+6, y+5);
1980 ctx.lineTo(x+10, y+3);
1981 ctx.closePath();
1982 ctx.fill();
1983 ctx.strokeText('1', x+45, y+10);
2015 ctx.beginPath();
2016 ctx.moveTo(x, y);
2017 ctx.lineTo(x+40, y+10);
2018 ctx.stroke();
2019 ctx.strokeText('2', x+45, y+10);
2023 ctx.beginPath();
2024 ctx.moveTo(arr[0].x, arr[0].y);
2025 ctx.lineTo(arr[1].x, arr[1].y);
2026 ctx.stroke();
2027 ctx.lineWidth = 1;
2032 ctx.beginPath();
2033 l_arrow(ctx, [{x:x, y:y+5}, {x:x+40, y:y+5}]);
2034 ctx.strokeText('2', x+45, y+10);
2038 ctx.beginPath();
2039 l_arrow(ctx, arr);
2040 ctx.lineWidth = 1;
2045 ctx.beginPath();
2046 l_tarrow(ctx, [{x:x, y:y+5}, {x:x+40, y:y+5}]);
2047 ctx.strokeText('2', x+45, y+10);
2051 ctx.beginPath();
2052 l_tarrow(ctx, arr);
2053 ctx.lineWidth = 1;
2058 ctx.beginPath();
2059 ctx.moveTo(x, y+3);
2060 ctx.lineTo(x+39, y+3);
2061 ctx.moveTo(x, y+7);
2062 ctx.lineTo(x+39, y+7);
2063 ctx.moveTo(x+35, y);
2064 ctx.lineTo(x+40, y+5);
2065 ctx.lineTo(x+35, y+10);
2066 ctx.stroke();
2067 ctx.strokeText('2', x+45, y+10);
2071 ctx.beginPath();
2072 l_darrow(ctx, arr);
2073 ctx.lineWidth = 1;
2079 ctx.beginPath();
2080 ctx.moveTo(x, y);
2081 ctx.quadraticCurveTo(x+20, y+20, x+40, y);
2082 ctx.stroke();
2083 ctx.strokeText('3', x+45, y+10);
2087 ctx.beginPath();
2088 ctx.moveTo(arr[0].x, arr[0].y);
2089 ctx.quadraticCurveTo(arr[1].x, arr[1].y, arr[2].x, arr[2].y);
2090 ctx.stroke();
2091 ctx.lineWidth = 1;
2097 ctx.beginPath();
2098 ctx.moveTo(x, y);
2099 ctx.quadraticCurveTo(x+20, y+20, x+40, y);
2100 l_hige(ctx, [{x:x+20, y:y+20}, {x:x+40, y:y}]);
2101 ctx.strokeText('3', x+45, y+10);
2105 ctx.beginPath();
2106 ctx.moveTo(arr[0].x, arr[0].y);
2107 ctx.quadraticCurveTo(arr[1].x, arr[1].y, arr[2].x, arr[2].y);
2108 l_hige(ctx, [arr[1], arr[2]]);
2109 ctx.lineWidth = 1;
2115 ctx.beginPath();
2116 ctx.moveTo(x, y);
2117 ctx.quadraticCurveTo(x+20, y+20, x+40, y);
2119 l_hige(ctx, a);
2122 l_hige(ctx, a);
2123 ctx.strokeText('3', x+45, y+10);
2127 ctx.beginPath();
2128 ctx.moveTo(arr[0].x, arr[0].y);
2129 ctx.quadraticCurveTo(arr[1].x, arr[1].y, arr[2].x, arr[2].y);
2133 l_hige(ctx, a);
2135 l_hige(ctx, a);
2136 ctx.lineWidth = 1;
2141 ctx.beginPath();
2142 ctx.rect(x, y, 40, 10);
2143 ctx.stroke();
2144 ctx.strokeText('2', x+45, y+10);
2148 ctx.beginPath();
2149 ctx.rect(arr[0].x, arr[0].y, arr[1].x-arr[0].x, arr[1].y-arr[0].y);
2150 ctx.stroke();
2151 ctx.lineWidth = 1;
2156 ctx.beginPath();
2157 ctx.scale(1.0, 0.5); // vertically half
2158 ctx.arc(x+20, (y+5)*2, 20, 0, 2 * Math.PI, false);
2159 ctx.stroke();
2160 ctx.scale(1.0, 2.0);
2161 ctx.strokeText('2', x+45, y+10);
2165 ctx.beginPath();
2166 l_elipse(ctx, arr);
2167 ctx.lineWidth = 1;
2172 ctx.beginPath();
2173 ctx.fillStyle = 'rgb(250, 250, 250)';
2174 ctx.fillRect(x, y, 40, 10);
2175 ctx.strokeText('2', x+45, y+10);
2181 ctx.beginPath();
2182 ctx.fillRect(arr[0].x, arr[0].y, arr[1].x-arr[0].x, arr[1].y-arr[0].y);
2186 ctx.beginPath();
2187 ctx.fillStyle = 'rgb(250, 250, 250)';
2188 ctx.scale(1.0, 0.5); // vertically half
2189 ctx.arc(x+20, (y+5)*2, 20, 0, 2 * Math.PI, false);
2190 ctx.fill();
2191 ctx.scale(1.0, 2.0);
2192 ctx.strokeText('2', x+45, y+10);
2198 ctx.beginPath();
2199 l_elipsef(ctx, arr);
2200 ctx.lineWidth = 1;
2205 ctx.beginPath();
2206 ctx.moveTo(x+8, y-3);
2207 ctx.lineTo(x+14, y+13);
2208 ctx.lineTo(x, y+2);
2209 ctx.lineTo(x+16, y+2);
2210 ctx.lineTo(x+2, y+13);
2211 ctx.closePath();
2212 ctx.stroke();
2213 ctx.strokeText('1', x+45, y+10);
2217 ctx.beginPath();
2219 l_star(ctx, arr);
2220 ctx.lineWidth = 1;
2225 ctx.beginPath();
2226 ctx.moveTo(x, y);
2227 ctx.lineTo(x+5, y+7);
2228 ctx.lineTo(x+20, y);
2229 ctx.stroke();
2230 ctx.strokeText('1', x+45, y+10);
2235 ctx.beginPath();
2236 l_check(ctx, arr);
2241 ctx.beginPath();
2242 ctx.strokeText(i18n.t('Text'), x+3, y+10);
2243 ctx.strokeText('1', x+45, y+10);
2252 ctx.beginPath();
2256 ctx.fillText(str, obj.points[0].x, obj.points[0].y);
2260 ctx.strokeStyle = '#0000ff';
2261 ctx.beginPath();
2262 ctx.moveTo(obj.points[0].x, obj.points[0].y + 4);
2263 ctx.lineTo(obj.points[0].x + ctx.measureText(str).width, obj.points[0].y + 4);
2264 ctx.stroke();
2267 ctx.font = setFont(14);
2401 ctx.beginPath();
2402 ctx.moveTo(x, y);
2403 ctx.lineTo(x+10, y+10);
2404 ctx.moveTo(x, y+10);
2405 ctx.lineTo(x+10, y);
2406 ctx.stroke();
2407 ctx.strokeText('1', x+45, y+10);
2412 ctx.beginPath();
2413 ctx.strokeText(i18n.t('Done'), x+3, y+10);
2414 ctx.beginPath();
2415 ctx.arc(x+9, y+5, 8, 0, 6.28, false);
2416 ctx.stroke();
2417 ctx.strokeText('1', x+45, y+10);
2422 ctx.beginPath();
2423 l_complete(ctx, arr);
2429 ctx.beginPath();
2430 ctx.moveTo(x, y);
2431 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2432 ctx.stroke();
2433 ctx.strokeText('n', x+45, y+10);
2439 ctx.beginPath();
2440 ctx.moveTo(arr[0].x, arr[0].y);
2444 ctx.bezierCurveTo(arr[i].cx, arr[i].cy, arr[i].dx, arr[i].dy, arr[i].x, arr[i].y);
2446 ctx.bezierCurveTo(arr[i].cx, arr[i].cy, arr[i].x, arr[i].y, arr[i].x, arr[i].y);
2449 ctx.bezierCurveTo(arr[i-1].x, arr[i-1].y, arr[i].dx, arr[i].dy, arr[i].x, arr[i].y);
2451 ctx.lineTo(arr[i].x, arr[i].y);
2453 ctx.stroke();
2463 ctx.beginPath();
2464 l_hige(ctx, a);
2475 ctx.beginPath();
2476 l_hige(ctx, a);
2478 ctx.lineWidth = 1;
2484 ctx.setLineDash([5]);
2485 ctx.beginPath();
2486 ctx.moveTo(pt0.x, pt0.y);
2487 ctx.lineTo(pt[name + "x"], pt[name + "y"]);
2488 ctx.stroke();
2489 ctx.setLineDash([]);
2595 ctx.beginPath();
2596 ctx.moveTo(x, y);
2597 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2598 ctx.stroke();
2599 l_hige(ctx, [{x: x+20, y: y-10}, {x: x+30, y: y+10}]);
2600 ctx.strokeText('n', x+45, y+10);
2612 ctx.beginPath();
2613 ctx.moveTo(x, y);
2614 ctx.bezierCurveTo(x+10, y+20, x+20, y-10, x+30, y+10);
2615 ctx.stroke();
2616 l_hige(ctx, [{x: x+10, y: y+20}, {x: x, y: y}]);
2617 l_hige(ctx, [{x: x+20, y: y-10}, {x: x+30, y: y+10}]);
2618 ctx.strokeText('n', x+45, y+10);