mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 19:33:28 +08:00
Work in progress
This commit is contained in:
@@ -59,7 +59,7 @@ public class MyCheckBox : MonoBehaviour
|
||||
cb.labelText.fontSize = fontSize;
|
||||
cb.SetLabelText(label);
|
||||
var width = cb.labelText.preferredWidth;
|
||||
cb.labelText.rectTransform.sizeDelta = new Vector2(width, rect.sizeDelta.y);
|
||||
cb.labelText.rectTransform.sizeDelta = new Vector2(width, cb.labelText.rectTransform.sizeDelta.y);
|
||||
}
|
||||
|
||||
//value
|
||||
@@ -86,4 +86,7 @@ public class MyCheckBox : MonoBehaviour
|
||||
checkImage.enabled = _checked;
|
||||
OnChecked?.Invoke();
|
||||
}
|
||||
|
||||
public float Width => rectTrans.sizeDelta.x + labelText.rectTransform.sizeDelta.x;
|
||||
public float Height => Math.Max(rectTrans.sizeDelta.y, labelText.rectTransform.sizeDelta.y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user