Beispiel #1
0
        public void CreateRenderGeometryAndAddToItemView(ItemView view, RenderedString renderedString, Rectf drawRect, Font font, Rectf?itemClipper, bool isSelected)
        {
            if (view.GetSelectionBrushImage() != null && isSelected)
            {
                var renderSettings   = new ImageRenderSettings(drawRect, itemClipper, true, view.GetSelectionColourRect());
                var brushGeomBuffers = view.GetSelectionBrushImage().CreateRenderGeometry(renderSettings);
                view.AppendGeometryBuffers(brushGeomBuffers);
            }

            var drawPos = drawRect.Position;

            for (var i = 0; i < renderedString.GetLineCount(); ++i)
            {
                drawPos.Y += CoordConverter.AlignToPixels((font.GetLineSpacing() - font.GetFontHeight()) * 0.5f);

                var stringGeomBuffers = renderedString.CreateRenderGeometry(view, i, drawPos, null, itemClipper, 0.0f);
                view.AppendGeometryBuffers(stringGeomBuffers);
                drawPos.Y += renderedString.GetPixelSize(view, i).Height;
            }
        }