modify layouter to fix height.

This commit is contained in:
hecomi
2016-11-19 13:49:38 +09:00
parent f207e65952
commit 60889d53f4
5 changed files with 5 additions and 4 deletions
@@ -125,8 +125,8 @@ public class MultipleMonitorCreator : MonoBehaviour
height = monitor.heightMeter; height = monitor.heightMeter;
break; break;
case ScaleMode.Fixed: case ScaleMode.Fixed:
width = scale * (monitor.isHorizontal ? 1f : monitor.aspect); width = scale * (monitor.isHorizontal ? monitor.aspect : 1f);
height = scale * (monitor.isHorizontal ? 1f / monitor.aspect : 1f); height = scale * (monitor.isHorizontal ? 1f : 1f / monitor.aspect);
break; break;
case ScaleMode.Pixel: case ScaleMode.Pixel:
width = scale * (monitor.isHorizontal ? 1f : monitor.aspect) * ((float)monitor.width / 1920); width = scale * (monitor.isHorizontal ? 1f : monitor.aspect) * ((float)monitor.width / 1920);
@@ -30,7 +30,7 @@ public class MultipleMonitorLayouter : MonoBehaviour
var totalWidth = 0f; var totalWidth = 0f;
foreach (var info in monitors) { foreach (var info in monitors) {
var width = info.gameObject.transform.localEulerAngles.x * (info.mesh.bounds.extents.x * 2f); var width = info.gameObject.transform.localScale.x * (info.mesh.bounds.extents.x * 2f);
totalWidth += width; totalWidth += width;
} }
totalWidth += margin * (n - 1); totalWidth += margin * (n - 1);
@@ -38,7 +38,7 @@ public class MultipleMonitorLayouter : MonoBehaviour
var x = -totalWidth / 2; var x = -totalWidth / 2;
foreach (var info in monitors) { foreach (var info in monitors) {
var width = info.gameObject.transform.localEulerAngles.x; var width = info.gameObject.transform.localScale.x;
x += (width * info.mesh.bounds.extents.x); x += (width * info.mesh.bounds.extents.x);
info.gameObject.transform.localPosition = new Vector3(x, 0f, 0f); info.gameObject.transform.localPosition = new Vector3(x, 0f, 0f);
info.gameObject.transform.localRotation = info.originalRotation; info.gameObject.transform.localRotation = info.originalRotation;
@@ -14,6 +14,7 @@ public enum Message
public enum CursorShapeType public enum CursorShapeType
{ {
Unspecified = 0,
MonoChrome = 1, MonoChrome = 1,
Color = 2, Color = 2,
MaskedColor = 4, MaskedColor = 4,