Skip to content

Commit bd636a2

Browse files
committed
better shift+ctrl scaling in Euclidean std projection
1 parent 691b095 commit bd636a2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

mapeditor.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,19 @@ EX namespace mapeditor {
380380
EX void scaleall(ld z, bool keep_mouse) {
381381

382382
if(keep_mouse) {
383-
ld mrx = (.0 + mousex - current_display->xcenter) / vpconf.scale;
384-
ld mry = (.0 + mousey - current_display->ycenter) / vpconf.scale;
383+
ld mrx = (.0 + mousex - current_display->xcenter);
384+
ld mry = (.0 + mousey - current_display->ycenter);
385385

386-
if(vid.xres > vid.yres) {
386+
if(euclid && pmodel == mdDisk) {
387+
ld tilerad = current_display->radius / (1 + vpconf.alpha);
388+
mrx /= tilerad;
389+
mry /= tilerad;
390+
ld s = (1-z);
391+
println(hlog, tie(mrx, mry, tilerad, s));
392+
View = eupush(s * mrx, s * mry) * View;
393+
}
394+
else if(vid.xres > vid.yres) {
395+
mrx /= vpconf.scale; mry /= vpconf.scale;
387396
vpconf.xposition += (vpconf.scale - vpconf.scale*z) * mrx / current_display->scrsize;
388397
vpconf.yposition += (vpconf.scale - vpconf.scale*z) * mry / current_display->scrsize;
389398
}

0 commit comments

Comments
 (0)