Skip to content

Commit

Permalink
0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kirjavascript committed Nov 24, 2017
1 parent 0b01ea9 commit 4ceee3b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion flex2.idea
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ change sprite scroll speed
drawing mode fill !
S - scroll to sprite
s3k sonic mapping definition / conversion tools
add flex.json to sonic 2 disassembly
create new file | newFactory={(path)=>{}}
04:43:53 <%Lil-G> i mean so when you do "delete unused tiles" it doesn't delete the tiles the other object uses
==

art offset loading / arbitrary data loader tab
mark sonmaped as obsolete
add flex.json to sonic 2 disassembly join #repo
2 changes: 2 additions & 0 deletions modules/components/import/get-sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export function getSprite(buffer, width, height, fuzziness = 0, startOffset = 0)
}

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

Expand Down
11 changes: 10 additions & 1 deletion modules/components/import/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,16 @@ class ImportState {
const { width, height } = canvas;
const buffer = ctx.getImageData(0, 0, width, height);
removeBackground(buffer);
ctx.putImageData(buffer, 0, 0);
/*
* moving the sprite 'fixes' a bug where fuzziness going
* out of bounds acts as a 'hit' by adding buffer space.
* has to be at least the size of the max fuzziness
*/
Object.assign(canvas, {
width: width+64,
height: height+64,
});
ctx.putImageData(buffer, 32, 32);
};

@action getBBoxes = () => {
Expand Down
2 changes: 0 additions & 2 deletions modules/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import './controls/keyboard';
import './components/import';

import Analytics from 'electron-google-analytics';

const devMode = /node_modules[\\/]electron[\\/]/.test(process.execPath);

if (!devMode) {
(new Analytics('UA-109903721-1'))
.pageview('http://flex2.kirjava.xyz', `/${packageJson.version}`, 'Main View')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Flex2",
"version": "0.0.4",
"version": "0.0.5",
"scripts": {
"start": "electron ./static --dev"
},
Expand Down
5 changes: 5 additions & 0 deletions styles/components/import.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
position: absolute;
}

.detect-canvas, .bbox {
margin-left: -31px;
margin-top: -31px;
}

.import-mapping {
position: absolute;
border: 1px solid $blue;
Expand Down

0 comments on commit 4ceee3b

Please sign in to comment.