()
| 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; |
nothing calls this directly
no test coverage detected