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
254 { nil, &key, CHANRCV },254 { nil, &key, CHANRCV },
255 { nil, nil, CHANEND },255 { nil, nil, CHANEND },
256 };256 };
257 float height;257 float oldheight, height;
258 Point oldxy, oldoffset;258 Point oldxy, oldoffset;
259 int oldb;259 int oldb;
260 260
@@ -283,6 +283,7 @@ threadmain(int argc, char **argv) · 22 unmodified lines
283 a[2].c = kctl->c;283 a[2].c = kctl->c;
284 memimageinit();284 memimageinit();
285 height = 32.0;285 height = 32.0;
286 oldheight = height;
286 oldxy = ZP;287 oldxy = ZP;
287 288
288 if(initfont(&fo, data, height) != 0)289 if(initfont(&fo, data, height) != 0)
@@ -299,8 +300,9 @@ threadmain(int argc, char **argv) · 10 unmodified lines
299 if(oldb == 0){300 if(oldb == 0){
300 oldxy = m.xy;301 oldxy = m.xy;
301 oldoffset = offset;302 oldoffset = offset;
303 oldheight = height;
302 }else if(m.buttons == 4){304 }else if(m.buttons == 4){
303 height += (m.xy.y - oldxy.y)/20.0;305 height = oldheight + (m.xy.y - oldxy.y)/20.0;
304 if(height < 4)306 if(height < 4)
305 height = 4;307 height = 4;
306 goto changed;308 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