MCPcopy
hub / github.com/1j01/jspaint / pointerup

Function pointerup

src/tools.js:225–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223 ctx_dest.putImageData(id_dest, rect_x, rect_y);
224 },
225 pointerup() {
226 $status_size.text("");
227 this.preview_canvas.width = 1;
228 this.preview_canvas.height = 1;
229
230 const contents_within_polygon = copy_contents_within_polygon(
231 main_canvas,
232 this.points,
233 this.x_min,
234 this.y_min,
235 this.x_max,
236 this.y_max
237 );
238
239 if (selection) {
240 // for silly multitools feature
241 show_error_message("This isn't supposed to happen: Free-Form Select after Select in the tool chain?");
242 meld_selection_into_canvas();
243 }
244
245 undoable({
246 name: localize("Free-Form Select"),
247 icon: get_icon_for_tool(get_tool_by_id(TOOL_FREE_FORM_SELECT)),
248 soft: true,
249 }, () => {
250 selection = new OnCanvasSelection(
251 this.x_min,
252 this.y_min,
253 this.x_max - this.x_min,
254 this.y_max - this.y_min,
255 contents_within_polygon,
256 );
257 selection.cut_out_background();
258 });
259 },
260 cancel() {
261 if (!this.preview_canvas) { return; }
262 this.preview_canvas.width = 1;

Callers

nothing calls this directly

Calls 13

show_error_messageFunction · 0.90
undoableFunction · 0.90
get_icon_for_toolFunction · 0.90
get_tool_by_idFunction · 0.90
localizeFunction · 0.85
get_languageFunction · 0.85
cut_out_backgroundMethod · 0.80
render_from_maskMethod · 0.80
completeMethod · 0.80
updateStatusMethod · 0.80

Tested by

no test coverage detected