Fix property value panel layout update.

This commit is contained in:
2022-11-15 12:06:00 +08:00
parent ea856f3339
commit 6444de41a2
2 changed files with 8 additions and 5 deletions

View File

@@ -24,10 +24,6 @@ namespace Cryville.Crtr.Browsing {
const float SPEED = 8;
float _ratio;
#pragma warning disable IDE0051
void Start() {
m_handleArea.sizeDelta = new Vector2(m_handle.rect.height - m_handle.rect.width, 0);
}
void Update() {
if (_value && _ratio != 1) {
_ratio += SPEED * Time.deltaTime;
@@ -40,6 +36,10 @@ namespace Cryville.Crtr.Browsing {
UpdateGraphics();
}
}
void OnRectTransformDimensionsChange() {
m_handleArea.sizeDelta = new Vector2(m_handle.rect.height - m_handle.rect.width, 0);
}
#pragma warning restore IDE0051
void UpdateGraphics() {

View File

@@ -60,7 +60,6 @@ namespace Cryville.Crtr.Browsing {
ev.callback.AddListener(e => OnPointerClick((PointerEventData)e));
m_ctn.triggers.Add(ev);
m_handleArea.sizeDelta = new Vector2(m_handle.rect.height - m_handle.rect.width, 0);
if (MaxStep != 0) SetRatio(0.5f);
}
@@ -70,6 +69,10 @@ namespace Cryville.Crtr.Browsing {
SetValueFromPos(pp);
}
}
void OnRectTransformDimensionsChange() {
m_handleArea.sizeDelta = new Vector2(m_handle.rect.height - m_handle.rect.width, 0);
}
#pragma warning restore IDE0051
Vector2 pp;