Skip to content

Commit

Permalink
magic wand tool renamed to magic eraser tool
Browse files Browse the repository at this point in the history
  • Loading branch information
viliusle committed Nov 22, 2020
1 parent e6de758 commit 78957f0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
File renamed without changes
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<title>miniPaint - image editor</title>
<meta name="description" content="miniPaint is free online image editor using HTML5. Edit, adjust your images, add effects online in your browser, without installing anything..." />
<meta name="keywords" content="photo, image, picture, transparent, layers, free, edit, html5, canvas, javascript, online, photoshop, gimp, effects, sharpen, blur, magic wand tool, clone tool, rotate, resize, photoshop online, online tools, tilt shift, sprites, keypoints" />
<meta name="keywords" content="photo, image, picture, transparent, layers, free, edit, html5, canvas, javascript, online, photoshop, gimp, effects, sharpen, blur, magic eraser tool, clone tool, rotate, resize, photoshop online, online tools, tilt shift, sprites, keypoints" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="images/favicon.png?v2" />
<!-- Google -->
Expand Down
2 changes: 1 addition & 1 deletion src/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ body .sp-preview{
.sidebar_left .pencil:after{ background-image: url('images/icons/pencil.svg'); }
.sidebar_left .pick_color:after{ background-image: url('images/icons/pick_color.svg'); }
.sidebar_left .erase:after{ background-image: url('images/icons/erase.svg'); }
.sidebar_left .magic_wand:after{ background-image: url('images/icons/magic_wand.svg'); }
.sidebar_left .magic_erase:after{ background-image: url('../../images/icons/magic_erase.svg'); }
.sidebar_left .fill:after{ background-image: url('images/icons/fill.svg'); }
.sidebar_left .line:after{ background-image: url('images/icons/line.svg'); }
.sidebar_left .rectangle:after{ background-image: url('images/icons/rectangle.svg'); }
Expand Down
4 changes: 2 additions & 2 deletions src/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ config.TOOLS = [
},
},
{
name: 'magic_wand',
title: 'Magic Wand Tool',
name: 'magic_erase',
title: 'Magic Eraser Tool',
attributes: {
power: 15,
anti_aliasing: true,
Expand Down
16 changes: 8 additions & 8 deletions src/js/tools/magic_wand.js → src/js/tools/magic_erase.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Base_tools_class from './../core/base-tools.js';
import Base_layers_class from './../core/base-layers.js';
import alertify from './../../../node_modules/alertifyjs/build/alertify.min.js';

class Magic_wand_class extends Base_tools_class {
class Magic_erase_class extends Base_tools_class {

constructor(ctx) {
super();
this.Base_layers = new Base_layers_class();
this.ctx = ctx;
this.name = 'magic_wand';
this.name = 'magic_erase';
}

dragStart(event) {
Expand Down Expand Up @@ -45,10 +45,10 @@ class Magic_wand_class extends Base_tools_class {

window.State.save();

this.magic_wand(mouse);
this.magic_erase(mouse);
}

magic_wand(mouse) {
magic_erase(mouse) {
var params = this.getParams();

if (config.layer.type != 'image') {
Expand Down Expand Up @@ -79,14 +79,14 @@ class Magic_wand_class extends Base_tools_class {
mouse_y = Math.round(mouse_y);

//change
this.magic_wand_general(ctx, config.WIDTH, config.HEIGHT,
this.magic_erase_general(ctx, config.WIDTH, config.HEIGHT,
mouse_x, mouse_y, params.power, params.anti_aliasing, params.contiguous);

this.Base_layers.update_layer_image(canvas);
}

/**
* apply magic wand
* apply magic erase
*
* @param {ctx} context
* @param {int} W
Expand All @@ -96,7 +96,7 @@ class Magic_wand_class extends Base_tools_class {
* @param {int} sensitivity max 100
* @param {Boolean} anti_aliasing
*/
magic_wand_general(context, W, H, x, y, sensitivity, anti_aliasing, contiguous = false) {
magic_erase_general(context, W, H, x, y, sensitivity, anti_aliasing, contiguous = false) {
sensitivity = sensitivity * 255 / 100; //convert to 0-255 interval
x = parseInt(x);
y = parseInt(y);
Expand Down Expand Up @@ -198,4 +198,4 @@ class Magic_wand_class extends Base_tools_class {
}

}
export default Magic_wand_class;
export default Magic_erase_class;

0 comments on commit 78957f0

Please sign in to comment.