Skip to content

Commit e0f759f

Browse files
Fix offset position of the signal delay window
1 parent 547bbb0 commit e0f759f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/RemoteTech/UI/TimeWarpDecorator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ public void Draw()
151151
Vector2 timeWarpImageScreenCoord = UIMainCamera.Camera.WorldToScreenPoint(mTimewarpTransform.position);
152152

153153
float scale = GameSettings.UI_SCALE_TIME * GameSettings.UI_SCALE;
154-
float topLeftTotimeQuadrant = Screen.height - (timeWarpImageScreenCoord.y - (mTimewarpTransform.rect.height * scale));
154+
float YToTimeQuadrant = Screen.height - (timeWarpImageScreenCoord.y - (mTimewarpTransform.rect.height * scale));
155+
float XToTimeQuadrant = 0; //compensated for KSP 1.12 alarm button
155156
float texBackgroundHeight = (mTexBackground.height * 0.7f) * scale;
156157
float texBackgroundWidth = (mTexBackground.width * 0.8111f) * scale;
157158

158-
Rect delaytextPosition = new Rect((timeWarpImageScreenCoord.x + 12.0f) * scale, topLeftTotimeQuadrant + 2 * scale, 50.0f * scale, 20.0f * scale);
159+
Rect delaytextPosition = new Rect((XToTimeQuadrant + 12.0f) * scale, YToTimeQuadrant + 2 * scale, 50.0f * scale, 20.0f * scale);
159160

160161
// calc the position under the timewarp object
161-
Rect pos = new Rect(timeWarpImageScreenCoord.x,
162-
topLeftTotimeQuadrant,
162+
Rect pos = new Rect(XToTimeQuadrant, YToTimeQuadrant,
163163
texBackgroundWidth, texBackgroundHeight);
164164

165165
// draw the image
@@ -177,7 +177,7 @@ public void Draw()
177177
GUI.Label(delaytextPosition, DisplayText, mTextStyle);
178178

179179
// draw the flightcomputer button to the right relative to the delaytext position
180-
Rect btnPos = new Rect((pos.x + 130.0f) * scale, topLeftTotimeQuadrant + 2 * scale, 21.0f * scale, 21.0f * scale);
180+
Rect btnPos = new Rect((pos.x + 130.0f) * scale, YToTimeQuadrant + 2 * scale, 21.0f * scale, 21.0f * scale);
181181

182182
GUILayout.BeginArea(btnPos);
183183
if (GUILayout.Button("", ButtonStyle))

0 commit comments

Comments
 (0)