~rabbits/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH left v2 1/2] modzoom: Instantly redraw

Details
Message ID
<20210111230923.5695-1-zachdecook@librem.one>
DKIM signature
missing
Download raw message
Patch: +1 -0
---
 left.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/left.c b/left.c
index 0f1b911..538cd64 100644
--- a/left.c
+++ b/left.c
@@ -625,6 +625,7 @@ modzoom(int mod)
	if((mod > 0 && ZOOM < 5) || (mod < 0 && ZOOM > 1)) {
		ZOOM += mod;
		SDL_SetWindowSize(gWindow, WIDTH * ZOOM, HEIGHT * ZOOM);
		redraw(pixels);
	}
}

-- 
2.29.2

[PATCH left v2 2/2] Window: Support HighDPI scaling

Details
Message ID
<20210111230923.5695-2-zachdecook@librem.one>
In-Reply-To
<20210111230923.5695-1-zachdecook@librem.one> (view parent)
DKIM signature
missing
Download raw message
Patch: +7 -6
---
 left.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/left.c b/left.c
index 538cd64..ed2a5f6 100644
--- a/left.c
+++ b/left.c
@@ -34,7 +34,8 @@ typedef struct {

int WIDTH = 8 * HOR + 8 * PAD * 2;
int HEIGHT = 8 * (VER + 2) + 8 * PAD * 2;
int FPS = 30, GUIDES = 1, ZOOM = 2, DOWN = 0;
int FPS = 30, GUIDES = 1, DOWN = 0;
float ZOOM = 1;
int RULER = 60;

/* interface */
@@ -620,9 +621,9 @@ modcase(Range s, int mod)
}

void
modzoom(int mod)
modzoom(float mod)
{
	if((mod > 0 && ZOOM < 5) || (mod < 0 && ZOOM > 1)) {
	if((mod > 0 && ZOOM < 5) || (mod < 0 && ZOOM > 0.5)) {
		ZOOM += mod;
		SDL_SetWindowSize(gWindow, WIDTH * ZOOM, HEIGHT * ZOOM);
		redraw(pixels);
@@ -772,12 +773,12 @@ dokey(SDL_Event *event)
	case SDLK_EQUALS:
	case SDLK_PLUS:
		if(ctrl)
			modzoom(1);
			modzoom(.5);
		break;
	case SDLK_UNDERSCORE:
	case SDLK_MINUS:
		if(ctrl)
			modzoom(-1);
			modzoom(-.5);
		break;
	case SDLK_LEFT:
		if(ctrl)
@@ -889,7 +890,7 @@ init(void)
		SDL_WINDOWPOS_UNDEFINED,
		WIDTH * ZOOM,
		HEIGHT * ZOOM,
		SDL_WINDOW_SHOWN);
		SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI);
	if(gWindow == NULL)
		return error("Window", SDL_GetError());
	gRenderer = SDL_CreateRenderer(gWindow, -1, 0);
-- 
2.29.2
Reply to thread Export thread (mbox)