1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-05-11 03:34:07 +00:00

better shift+ctrl scaling in Euclidean std projection

This commit is contained in:
Zeno Rogue 2025-03-27 15:53:11 +01:00
parent 691b0959a2
commit bd636a20ba

View File

@ -380,10 +380,19 @@ EX namespace mapeditor {
EX void scaleall(ld z, bool keep_mouse) {
if(keep_mouse) {
ld mrx = (.0 + mousex - current_display->xcenter) / vpconf.scale;
ld mry = (.0 + mousey - current_display->ycenter) / vpconf.scale;
ld mrx = (.0 + mousex - current_display->xcenter);
ld mry = (.0 + mousey - current_display->ycenter);
if(vid.xres > vid.yres) {
if(euclid && pmodel == mdDisk) {
ld tilerad = current_display->radius / (1 + vpconf.alpha);
mrx /= tilerad;
mry /= tilerad;
ld s = (1-z);
println(hlog, tie(mrx, mry, tilerad, s));
View = eupush(s * mrx, s * mry) * View;
}
else if(vid.xres > vid.yres) {
mrx /= vpconf.scale; mry /= vpconf.scale;
vpconf.xposition += (vpconf.scale - vpconf.scale*z) * mrx / current_display->scrsize;
vpconf.yposition += (vpconf.scale - vpconf.scale*z) * mry / current_display->scrsize;
}