Skip to content

Commit 4ceee3b

Browse files
committed
0.0.5
1 parent 0b01ea9 commit 4ceee3b

6 files changed

Lines changed: 19 additions & 5 deletions

File tree

flex2.idea

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ change sprite scroll speed
55
drawing mode fill !
66
S - scroll to sprite
77
s3k sonic mapping definition / conversion tools
8-
add flex.json to sonic 2 disassembly
98
create new file | newFactory={(path)=>{}}
109
04:43:53 <%Lil-G> i mean so when you do "delete unused tiles" it doesn't delete the tiles the other object uses
1110
==
1211

1312
art offset loading / arbitrary data loader tab
1413
mark sonmaped as obsolete
14+
add flex.json to sonic 2 disassembly join #repo

modules/components/import/get-sprite.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export function getSprite(buffer, width, height, fuzziness = 0, startOffset = 0)
4747
}
4848

4949
function checkMatch(pos) {
50+
const { x, y } = getXY(pos);
51+
if (x < 0 || y < 0 || x >= width || y >= height) return true;
5052
return buffer.data[pos+3] !== 0;
5153
}
5254

modules/components/import/state.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,16 @@ class ImportState {
8686
const { width, height } = canvas;
8787
const buffer = ctx.getImageData(0, 0, width, height);
8888
removeBackground(buffer);
89-
ctx.putImageData(buffer, 0, 0);
89+
/*
90+
* moving the sprite 'fixes' a bug where fuzziness going
91+
* out of bounds acts as a 'hit' by adding buffer space.
92+
* has to be at least the size of the max fuzziness
93+
*/
94+
Object.assign(canvas, {
95+
width: width+64,
96+
height: height+64,
97+
});
98+
ctx.putImageData(buffer, 32, 32);
9099
};
91100

92101
@action getBBoxes = () => {

modules/root.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import './controls/keyboard';
77
import './components/import';
88

99
import Analytics from 'electron-google-analytics';
10-
1110
const devMode = /node_modules[\\/]electron[\\/]/.test(process.execPath);
12-
1311
if (!devMode) {
1412
(new Analytics('UA-109903721-1'))
1513
.pageview('http://flex2.kirjava.xyz', `/${packageJson.version}`, 'Main View')

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Flex2",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"scripts": {
55
"start": "electron ./static --dev"
66
},

styles/components/import.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
position: absolute;
6767
}
6868

69+
.detect-canvas, .bbox {
70+
margin-left: -31px;
71+
margin-top: -31px;
72+
}
73+
6974
.import-mapping {
7075
position: absolute;
7176
border: 1px solid $blue;

0 commit comments

Comments
 (0)