Пример #1
0
 /// <summary>
 /// Combines two <see cref="LineTransform"/> objects.
 /// </summary>
 /// <param name="transform1">The first <see cref="LineTransform"/> to combine.</param>
 /// <param name="transform2">The second <see cref="LineTransform"/> to combine.</param>
 /// <returns>The combined <see cref="LineTransform"/>.</returns>
 public static LineTransform Combine(LineTransform transform1, LineTransform transform2)
 {
     return(new LineTransform(Math.Max(transform1.TopSpace, transform2.TopSpace),
                              Math.Max(transform1.BottomSpace, transform2.BottomSpace),
                              transform1.VerticalScale * transform2.VerticalScale,
                              Math.Max(transform1.Right, transform2.Right)));
 }
Пример #2
0
 /// <summary>
 /// Determines whether two <see cref="LineTransform"/> objects are the same.
 /// </summary>
 /// <param name="obj">The object to compare for equality.</param>
 public override bool Equals(object obj)
 {
     if (obj is LineTransform)
     {
         LineTransform other = (LineTransform)obj;
         return(this == other);
     }
     else
     {
         return(false);
     }
 }
Пример #3
0
        public override void SetLineTransform(VSTF.LineTransform transform)
        {
            if (!IsValid)
            {
                throw new ObjectDisposedException(nameof(HexFormattedLineImpl));
            }
            var  oldScaledTopSpace = scaledTopSpace;
            bool resetTransform    = lineTransform.VerticalScale != transform.VerticalScale;

            lineTransform    = transform;
            scaledTopSpace   = Math.Ceiling(Math.Max(transform.TopSpace, realTopSpace) * transform.VerticalScale);
            scaledTextHeight = Math.Ceiling(realTextHeight * transform.VerticalScale);
            scaledHeight     = scaledTextHeight + scaledTopSpace + Math.Ceiling(Math.Max(transform.BottomSpace, realBottomSpace) * transform.VerticalScale);
            if (resetTransform || scaledTopSpace != oldScaledTopSpace)
            {
                UpdateVisualTransform();
            }
        }
Пример #4
0
 /// <summary>
 /// Sets a new line transform
 /// </summary>
 /// <param name="transform">New line transform</param>
 public abstract void SetLineTransform(VSTF.LineTransform transform);