MCPcopy
hub / github.com/viliusle/miniPaint / mouseup

Method mouseup

src/js/tools/pencil.js:130–157  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

128 }
129
130 mouseup(e) {
131 var mouse = this.get_mouse_info(e);
132 var params = this.getParams();
133 if (mouse.click_valid == false) {
134 config.layer.status = null;
135 return;
136 }
137
138 //detect line size
139 var size = params.size;
140 var new_size = size;
141
142 if (params.pressure == true && this.pressure_supported) {
143 new_size = size * this.pointer_pressure * 2;
144 }
145
146 //more data
147 config.layer.data.push([
148 Math.ceil(mouse.x - config.layer.x),
149 Math.ceil(mouse.y - config.layer.y),
150 new_size
151 ]);
152
153 this.check_dimensions();
154
155 config.layer.status = null;
156 this.Base_layers.render();
157 }
158
159 render(ctx, layer) {
160 this.render_aliased(ctx, layer);

Callers

nothing calls this directly

Calls 4

check_dimensionsMethod · 0.95
get_mouse_infoMethod · 0.80
getParamsMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected