예제 #1
0
        // Token: 0x06006620 RID: 26144 RVA: 0x001CB6C8 File Offset: 0x001C98C8
        public override TextEmbeddedObjectMetrics Format(double remainingParagraphWidth)
        {
            Size size = this._host.MeasureChild(this);

            TextDpi.EnsureValidObjSize(ref size);
            double baseline = size.Height;
            double num      = (double)this.Element.GetValue(TextBlock.BaselineOffsetProperty);

            if (!DoubleUtil.IsNaN(num))
            {
                baseline = num;
            }
            return(new TextEmbeddedObjectMetrics(size.Width, size.Height, baseline));
        }
예제 #2
0
        /// <summary>
        /// Get inline object's measurement metrics.
        /// </summary>
        /// <param name="remainingParagraphWidth">Remaining paragraph width.</param>
        /// <returns>Inline object metrics.</returns>
        public override TextEmbeddedObjectMetrics Format(double remainingParagraphWidth)
        {
            Size desiredSize = _host.MeasureChild(this);

            // Make sure that LS/PTS limitations are not exceeded for object's size.
            TextDpi.EnsureValidObjSize(ref desiredSize);

            double baseline            = desiredSize.Height;
            double baselineOffsetValue = (double)Element.GetValue(TextBlock.BaselineOffsetProperty);

            if (!DoubleUtil.IsNaN(baselineOffsetValue))
            {
                baseline = baselineOffsetValue;
            }
            return(new TextEmbeddedObjectMetrics(desiredSize.Width, desiredSize.Height, baseline));
        }
 // Token: 0x06006677 RID: 26231 RVA: 0x001CC5BC File Offset: 0x001CA7BC
 internal static Rect FromTextRect(PTS.FSRECT fsrect)
 {
     return(new Rect(TextDpi.FromTextDpi(fsrect.u), TextDpi.FromTextDpi(fsrect.v), TextDpi.FromTextDpi(fsrect.du), TextDpi.FromTextDpi(fsrect.dv)));
 }
 // Token: 0x06006679 RID: 26233 RVA: 0x001CC622 File Offset: 0x001CA822
 internal static void SnapToTextDpi(ref Size size)
 {
     size = new Size(TextDpi.FromTextDpi(TextDpi.ToTextDpi(size.Width)), TextDpi.FromTextDpi(TextDpi.ToTextDpi(size.Height)));
 }