~rabbits/dotgrid

8fccd21c7f37698ce1ed104f9960ff7692c92ba2 — neauoire 2 years ago d3c17bb
Starting new transform implementation
2 files changed, 13 insertions(+), 8 deletions(-)

M README.md
M dotgrid.c
M README.md => README.md +1 -0
@@ 59,3 59,4 @@ To resume working on a shape:

- use fscan to parse file
- re-implement transforms starting from the end of the paths.
- fix issue where point ends up unmagnetized
\ No newline at end of file

M dotgrid.c => dotgrid.c +12 -8
@@ 93,9 93,12 @@ Uint8 icons[][8] = {
	{0x00, 0x00, 0x00, 0x82, 0x44, 0x38, 0x00, 0x00}, /* eye open */
	{0x00, 0x38, 0x44, 0x92, 0x28, 0x10, 0x00, 0x00}, /* eye closed */
	{0x10, 0x54, 0x28, 0xc6, 0x28, 0x54, 0x10, 0x00}, /* unsaved */
	{0x16, 0x16, 0x76, 0xce, 0xbc, 0xb0, 0xb0, 0x00}, /* cap:round */
	{0x16, 0x16, 0xf6, 0x86, 0xbe, 0xb0, 0xb0, 0x00}, /* cap:square */
	{0x16, 0x14, 0x2c, 0x28, 0x58, 0x50, 0xb0, 0x00}  /* cap:diagonal */
	{0x04, 0x0a, 0x7a, 0x82, 0xbc, 0xa0, 0x40, 0x00}, /* cap:round */
	{0x0e, 0x0a, 0xfa, 0x82, 0xbe, 0xa0, 0xe0, 0x00}, /* cap:square */
	{0x0a, 0x14, 0x14, 0x28, 0x50, 0x50, 0xa0, 0x00}, /* cap:diagonal */
	{0x0e, 0x06, 0x0a, 0x10, 0x22, 0x40, 0xaa, 0x00}, /* transform:translate */
	{0x02, 0x7c, 0x52, 0x70, 0x42, 0x40, 0xaa, 0x00}, /* transform:scale */
	{0x0e, 0x30, 0x42, 0x40, 0x82, 0x80, 0xaa, 0x00}  /* transform:rotate */
};

SDL_Window *gWindow = NULL;


@@ 566,7 569,7 @@ drawui(Uint32 *dst)
	drawicn(dst, 7 * 8, bottom, icons[5], cancast(RECTANGLE) ? 2 : 3, 0);
	drawicn(dst, 8 * 8, bottom, icons[1], cancast(ELLIPSE) ? 2 : 3, 0);
	drawicn(dst, 9 * 8, bottom, icons[8], cancast(TRIANGLE) ? 2 : 3, 0);
	if(selection) {
	if(selection && selection->size > 1) {
		drawicn(dst, 11 * 8, bottom, icons[12], selection->cap == ROUND ? 1 : 2, 0);
		drawicn(dst, 12 * 8, bottom, icons[13], selection->cap == SQUARE ? 1 : 2, 0);
		drawicn(dst, 13 * 8, bottom, icons[14], selection->cap == DIAGONAL ? 1 : 2, 0);


@@ 575,7 578,10 @@ drawui(Uint32 *dst)
		drawicn(dst, 12 * 8, bottom, icons[13], 3, 0);
		drawicn(dst, 13 * 8, bottom, icons[14], 3, 0);
	}
	drawicn(dst, 16 * 8, bottom, icons[GUIDES ? 10 : 9], GUIDES ? 1 : 2, 0);
	drawicn(dst, 15 * 8, bottom, icons[15], 3, 0);
	drawicn(dst, 16 * 8, bottom, icons[16], 3, 0);
	drawicn(dst, 17 * 8, bottom, icons[17], 3, 0);
	drawicn(dst, 19 * 8, bottom, icons[GUIDES ? 10 : 9], GUIDES ? 1 : 2, 0);
	drawicn(dst, (HOR - 1) * 8, bottom, icons[11], doc.unsaved ? 2 : 3, 0); /* save state */
}



@@ 901,12 907,10 @@ selectoption(int option)
	case 7: cast(RECTANGLE); break;
	case 8: cast(ELLIPSE); break;
	case 9: cast(TRIANGLE); break;

	case 11: setcap(ROUND); break;
	case 12: setcap(SQUARE); break;
	case 13: setcap(DIAGONAL); break;

	case 16: savemode(&GUIDES, !GUIDES); break;
	case 19: savemode(&GUIDES, !GUIDES); break;
	}
}