Skip to content

Commit 5b2e6a6

Browse files
committed
Update assets.ts, app.ts, editor.ts, cursor.ts
1 parent a9280a4 commit 5b2e6a6

4 files changed

Lines changed: 224 additions & 115 deletions

File tree

app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace kojac {
1616
constructor() {
1717
// One interval delay to ensure all static constructors have executed.
1818
setTimeout(() => {
19-
controller.setRepeatDefault(200, 20);
19+
controller.setRepeatDefault(250, 30);
2020
icons.init();
2121
this.stageManager = new StageManager();
2222
const home = new Home(this);

assets.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@ namespace icondb {
249249
. . . . . . . . . . . . . . . .
250250
. . . . . . . . . . . . . . . .
251251
. . . . . . . . . . . . . . . .
252-
. . . . c c . . . c c . . . . .
253-
. . . . c c c . c c c . . . . .
254-
. . . . b c c c c c b . . . . .
255-
. . . . . b c c c b . . . . . .
256-
. . . . . c c c c c . . . . . .
257-
. . . . c c c b c c c . . . . .
258-
. . . . c c b . b c c . . . . .
259-
. . . . b b . . . b b . . . . .
252+
. . . . . c c . . . c c . . . .
253+
. . . . . c c c . c c c . . . .
254+
. . . . . b c c c c c b . . . .
255+
. . . . . . b c c c b . . . . .
256+
. . . . . . c c c c c . . . . .
257+
. . . . . c c c b c c c . . . .
258+
. . . . . c c b . b c c . . . .
259+
. . . . . b b . . . b b . . . .
260260
. . . . . . . . . . . . . . . .
261261
. . . . . . . . . . . . . . . .
262262
. . . . . . . . . . . . . . . .

cursor.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace kojac {
99
const LERP_SPEED = 12;
1010
const SEARCH_INCR = 8;
1111
const SEARCH_MAX = 160;
12+
const SEARCH_SLOPE = 1.8;
1213

1314
export class Cursor extends Component {
1415
stylus: Kelpie;
@@ -62,7 +63,7 @@ namespace kojac {
6263
boundsFn: (dist: number) => Bounds;
6364
filterFn: (value: Button, dist: number) => boolean;
6465
}) {
65-
if (this.transiting()) return;
66+
//if (this.transiting()) return;
6667
let dist = SEARCH_INCR;
6768
let candidates: Button[];
6869
let overlapping = this.getOverlapping();
@@ -109,7 +110,7 @@ namespace kojac {
109110
// Filter to upward buttons that are more up than left or right from us.
110111
return (
111112
pos.y < this.y &&
112-
Math.abs(pos.y - this.y) > Math.abs(pos.x - this.x));
113+
(Math.abs(pos.y - this.y) / Math.abs(pos.x - this.x)) > SEARCH_SLOPE);
113114
}
114115
});
115116
}
@@ -129,7 +130,7 @@ namespace kojac {
129130
// Filter to downward buttons that are more down than left or right from us.
130131
return (
131132
pos.y > this.y &&
132-
Math.abs(pos.y - this.y) > Math.abs(pos.x - this.x));
133+
(Math.abs(pos.y - this.y) / Math.abs(pos.x - this.x)) > SEARCH_SLOPE);
133134
}
134135
});
135136
}
@@ -149,7 +150,7 @@ namespace kojac {
149150
// Filter to leftward buttons that are more left than up or down from us.
150151
return (
151152
pos.x < this.x &&
152-
Math.abs(pos.y - this.y) < Math.abs(pos.x - this.x));
153+
(Math.abs(pos.x - this.x) / Math.abs(pos.y - this.y)) > SEARCH_SLOPE);
153154
}
154155
});
155156
}
@@ -169,7 +170,7 @@ namespace kojac {
169170
// Filter to rightward buttons that are to more right than up or down from us.
170171
return (
171172
pos.x > this.x &&
172-
Math.abs(pos.y - this.y) < Math.abs(pos.x - this.x));
173+
(Math.abs(pos.x - this.x) / Math.abs(pos.y - this.y)) > SEARCH_SLOPE);
173174
}
174175
});
175176
}

0 commit comments

Comments
 (0)