diff --git a/cell.cpp b/cell.cpp index 3e2448ec..a1da6f8c 100644 --- a/cell.cpp +++ b/cell.cpp @@ -1371,4 +1371,9 @@ EX int valence() { return S3; } +/** portalspaces are not defined outside of a boundary */ +EX bool is_boundary(cell *c) { + return (cgflags & qPORTALSPACE) && isWall(c->wall); + } + } diff --git a/hypgraph.cpp b/hypgraph.cpp index 2dafd989..b7978dc2 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -1955,6 +1955,8 @@ EX void centerpc(ld aspd) { ors::rerotate(W); ors::rerotate(cwtV.T); ors::rerotate(View); } +EX transmatrix oView; + EX void optimizeview() { if(subscreens::split(optimizeview)) return; @@ -1971,6 +1973,11 @@ EX void optimizeview() { View = iview_inverse(iView); fixmatrix(View); + + if(is_boundary(centerover)) + centerover = c, View = oView; + else + oView = View; #if CAP_ANIMATIONS if(centerover && inmirror(centerover)) {