コード例 #1
0
        /// <summary>
        /// Updates <see cref="MaskTransform"/> and <see cref="Maskeds"/>.
        /// </summary>
        private void RecalculateMaskTransform()
        {
            // Compute bounds and scale.
            var bounds = Masks.GetBounds();
            var scale  = (bounds.size.x > bounds.size.y)
                ? bounds.size.x
                : bounds.size.y;


            // Compute mask transform.
            MaskTransform = new CubismMaskTransform
            {
                Offset = bounds.center,
                Scale  = 1f / scale
            };
        }