public SizeF GetTextSize(SizeF proposedSize, TextParams textParams) { if (this.isDirty) { this.isDirty = false; this.TextBlock = TinyHTMLParsers.Parse(textParams); } return(this.TextBlock.GetTextSize(proposedSize, textParams)); }
public SizeF GetTextSize(TextParams textParams) { if (this.isDirty) { this.isDirty = false; this.TextBlock = TinyHTMLParsers.Parse(textParams); } return(this.TextBlock.GetTextSize(new SizeF(float.MaxValue, float.MaxValue), textParams)); }
public SizeF MeasureOverride(SizeF availableSize, TextParams textParams) { this.isDirty = false; this.TextBlock = TinyHTMLParsers.Parse(textParams); Size size1 = Size.Ceiling(this.TextBlock.GetTextSize(availableSize, textParams)); Size size2 = LayoutUtils.FlipSizeIf(textParams.textOrientation == Orientation.Vertical, size1); Size size3 = LayoutUtils.FlipSizeIf(textParams.textOrientation == Orientation.Vertical, size1); size2.Width = Math.Max(size2.Width, size3.Width); size2.Height = Math.Max(size2.Height, size3.Height); return((SizeF)size2); }
public SizeF GetTextSize(TextParams textParams) { if (this.isDirty) { this.isDirty = false; this.TextBlock = TinyHTMLParsers.Parse(textParams); } SizeF proposedSize = new SizeF(float.MaxValue, float.MaxValue); SizeF textSize = this.TextBlock.GetTextSize(proposedSize, textParams); return(textSize); }
public void PaintPrimitive(Telerik.WinControls.Paint.IGraphics graphics, float angle, System.Drawing.SizeF scale, TextParams textParams) { if (this.isDirty) { this.isDirty = false; this.TextBlock = TinyHTMLParsers.Parse(textParams); } RectangleF paintingRectangle = textParams.paintingRectangle; StringFormat format = textParams.CreateStringFormat(); this.TextBlock.PaintFormatTextBlock(graphics, paintingRectangle, true, format, TextFormatFlags.Default, textParams.textWrap, textParams.ClipText); format.Dispose(); }
public void PaintPrimitive( IGraphics graphics, float angle, SizeF scale, TextParams textParams) { if (this.isDirty) { this.isDirty = false; this.TextBlock = TinyHTMLParsers.Parse(textParams); } RectangleF paintingRectangle = textParams.paintingRectangle; StringFormat stringFormat = textParams.CreateStringFormat(); Graphics underlayGraphics = (Graphics)graphics.UnderlayGraphics; TextRenderingHint textRenderingHint = underlayGraphics.TextRenderingHint; underlayGraphics.TextRenderingHint = textParams.textRenderingHint; this.TextBlock.PaintFormatTextBlock(graphics, paintingRectangle, true, stringFormat, TextFormatFlags.Default, textParams.textWrap, textParams.ClipText); underlayGraphics.TextRenderingHint = textRenderingHint; stringFormat.Dispose(); }
public System.Drawing.SizeF MeasureOverride(System.Drawing.SizeF availableSize, TextParams textParams) { if (previousAvailableSize != availableSize) { this.isDirty = true; previousAvailableSize = availableSize; } if (this.isDirty) { this.isDirty = false; this.TextBlock = TinyHTMLParsers.Parse(textParams); } Size textSize = Size.Ceiling(this.TextBlock.GetTextSize(availableSize, textParams)); Size res = LayoutUtils.FlipSizeIf(textParams.textOrientation == Orientation.Vertical, textSize); Size minSize = LayoutUtils.FlipSizeIf(textParams.textOrientation == Orientation.Vertical, textSize); res.Width = Math.Max(res.Width, minSize.Width); res.Height = Math.Max(res.Height, minSize.Height); return(res); }