Skip to content

Commit 3515ccb

Browse files
committed
🧰: delete colorstop when selecting inside of halo
1 parent 1a40404 commit 3515ccb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lively.ide/styling/color-stops.cp.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import KeyHandler from 'lively.morphic/events/KeyHandler.js';
77
export class ColorStopControl extends Polygon {
88
static get properties () {
99
return {
10+
editor: {},
1011
stop: {},
1112
isSelected: {},
1213
isColorStop: {
@@ -54,6 +55,12 @@ export class ColorStopControl extends Polygon {
5455
this.bottomCenter = gradientEditor.getPositionFor(this.stop);
5556
}
5657

58+
onKeyDown (evt) {
59+
if (evt.keyCombo === 'Delete') {
60+
this.editor.removeStop(this);
61+
}
62+
}
63+
5764
onMouseDown (evt) {
5865
super.onMouseDown(evt);
5966
this.select(this);

lively.ide/styling/gradient-editor.cp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ export class GradientControlModel extends ViewModel {
420420
}
421421

422422
getControlFor (aStop, haloOrEditor = this) {
423-
const s = part(ColorStop, { master: { states: { selected: SelectedColorStop } } });
423+
const s = part(ColorStop, { master: { states: { selected: SelectedColorStop } }, editor: this });
424424
s.withAllSubmorphsDo(m => m.halosEnabled = false);
425425
haloOrEditor.placeStop(s);
426426
connect(s, 'select', haloOrEditor, 'selectStop');

0 commit comments

Comments
 (0)