History

better resizing

Sigrid Haflínudóttir committed 6 years ago

Commit 189db4a1 parent 3dcfcd51 file · +4 −2Browse files

Unified · Split

test.c+4−2
@@ -254,7 +254,7 @@ threadmain(int argc, char **argv) · 253 unmodified lines
254254 { nil, &key, CHANRCV },
255255 { nil, nil, CHANEND },
256256 };
257− float height;
257+ float oldheight, height;
258258 Point oldxy, oldoffset;
259259 int oldb;
260260
@@ -283,6 +283,7 @@ threadmain(int argc, char **argv) · 22 unmodified lines
283283 a[2].c = kctl->c;
284284 memimageinit();
285285 height = 32.0;
286+ oldheight = height;
286287 oldxy = ZP;
287288
288289 if(initfont(&fo, data, height) != 0)
@@ -299,8 +300,9 @@ threadmain(int argc, char **argv) · 10 unmodified lines
299300 if(oldb == 0){
300301 oldxy = m.xy;
301302 oldoffset = offset;
303+ oldheight = height;
302304 }else if(m.buttons == 4){
303− height += (m.xy.y - oldxy.y)/20.0;
305+ height = oldheight + (m.xy.y - oldxy.y)/20.0;
304306 if(height < 4)
305307 height = 4;
306308 goto changed;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t