Ejemplo n.º 1
0
        /// <summary>
        /// Updates the internal label to match the given original label.
        /// </summary>
        private void UpdateDummyLabel(ICanvasContext context, ILabel original)
        {
            dummyLabel.Owner = original.Owner;
            dummyLabel.Style = original.Style;
            dummyLabel.Tag   = original.Tag;
            dummyLabel.Text  = original.Text;

            var location = original.GetLayout();

            rectangle.Reshape(location);
            rectangle.Width  = location.Width / context.Zoom;
            rectangle.Height = location.Height / context.Zoom;

            dummyLabel.PreferredSize = rectangle.ToSizeD();
            rectangle.Reshape(original.LayoutParameter.Model.GetGeometry(dummyLabel, original.LayoutParameter));
            dummyLabel.PreferredSize = location.ToSizeD();
            WorldToIntermediateCoordinates(context, rectangle);
        }