~rabbits/nasu

1f6f409c936722706db09510404f8c6d802e85ba — Devine Lu Linvega 2 years ago ea88f27
Fixed line issue
1 files changed, 7 insertions(+), 4 deletions(-)

M nasu.c
M nasu.c => nasu.c +7 -4
@@ 296,10 296,12 @@ domouse(SDL_Event* event, Brush* b)
			b->erase = 1;
		if(event->button.button == SDL_BUTTON_MIDDLE) {
			b->erase = 0;
			b->x = (event->motion.x - (PAD * ZOOM)) / ZOOM;
			b->y = (event->motion.y - (PAD * ZOOM)) / ZOOM;
			line(b->px, b->py, b->x, b->y, b->erase ? 0 : b->color);
			draw(pixels);
			if(b->px != 0 && b->py != 0) {
				b->x = (event->motion.x - (PAD * ZOOM)) / ZOOM;
				b->y = (event->motion.y - (PAD * ZOOM)) / ZOOM;
				line(b->px, b->py, b->x, b->y, b->erase ? 0 : b->color);
				draw(pixels);
			}
		}
		b->px = (event->motion.x - (PAD * ZOOM)) / ZOOM;
		b->py = (event->motion.y - (PAD * ZOOM)) / ZOOM;


@@ 341,6 343,7 @@ dokey(SDL_Event* event, Brush* b)
		break;
	case SDLK_n:
		newchr();
		draw(pixels);
		break;
	case SDLK_BACKQUOTE:
		b->mode = 7;