Browse Source

Fixed round brush

main
neauoire 5 years ago
parent
commit
2c4be60bf4
  1. 8
      nasu.c

8
nasu.c

@ -167,7 +167,7 @@ fill(int x, int y, int mode, int size, int color)
int ox, oy; int ox, oy;
for(ox = x - (size / 2); ox < x + size; ++ox) for(ox = x - (size / 2); ox < x + size; ++ox)
for(oy = y - (size / 2); oy < y + size; ++oy) for(oy = y - (size / 2); oy < y + size; ++oy)
if(distance(x, y, ox, oy) < size) if(distance(x, y, ox, oy) > size)
continue; continue;
else if(mode == 4 && jagg(ox, oy)) else if(mode == 4 && jagg(ox, oy))
putchr(ox, oy, 0); putchr(ox, oy, 0);
@ -525,24 +525,18 @@ int
main(int argc, char **argv) main(int argc, char **argv)
{ {
int ticknext = 0; int ticknext = 0;
brush.erase = 0; brush.erase = 0;
brush.down = 0; brush.down = 0;
brush.color = 1; brush.color = 1;
brush.size = 8; brush.size = 8;
brush.mode = 0; brush.mode = 0;
if(!init()) if(!init())
return error("Init", "Failure"); return error("Init", "Failure");
loadtheme(fopen("theme.svg", "r")); loadtheme(fopen("theme.svg", "r"));
newchr(); newchr();
if(argc > 1) if(argc > 1)
loadchr(fopen(argv[1], "r")); loadchr(fopen(argv[1], "r"));
redraw(pixels); redraw(pixels);
while(1) { while(1) {
int tick = SDL_GetTicks(); int tick = SDL_GetTicks();
SDL_Event event; SDL_Event event;

Loading…
Cancel
Save