File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 44
55#include < assert.h>
66#include < algorithm>
7+ #include < cmath>
78#include < vector>
89#include < filesystem>
910#include < array>
2223#include " GameConfiguration.h"
2324#include " StonesenseState.h"
2425
26+ #include " modules/Screen.h"
2527#include " modules/Units.h"
2628#include " DataDefs.h"
2729
@@ -907,6 +909,18 @@ void paintboard()
907909 return ;
908910 }
909911
912+ if (df::global::plotinfo->follow_unit != -1 ) {
913+ if (DFHack::Screen::inGraphicsMode ()) {
914+ auto zoom = stonesenseState.ssConfig .zoom ;
915+ auto xOff = int (-0.134 * std::pow (zoom, 2 ) + 2.911 * zoom - 21.214 );
916+ stonesenseState.ssConfig .config .viewOffset = { xOff,0 ,0 };
917+ }
918+ else {
919+ stonesenseState.ssConfig .config .viewOffset = { -46 ,0 ,0 };
920+ }
921+ }
922+
923+
910924 segment->DrawAllTiles ();
911925
912926 if (ssConfig.config .show_osd ) {
You can’t perform that action at this time.
0 commit comments