コード例 #1
0
        protected override CPoint transformToPhysicalPixels(Vector2 point, out IntMatrix?intMatrix)
        {
            Matrix3x2 tform = transform.current;

            point     = Vector2.Transform(point, tform);
            point    *= device.dpiScaling.mulPixels;
            intMatrix = tform.snapMatrixToInt();
            return(point.roundToInt());
        }
コード例 #2
0
        CSize iDrawContext.measureText(string text, float width, iFont fontInterface)
        {
            Matrix3x2 curr        = transform.current;
            float     pixel       = computePixelSize(ref curr);
            int       widthPIxels = (int)MathF.Round(width / pixel);

            Matrix3x2      tform      = transform.current;
            eTextRendering renderMode = textRenderingStyle(tform.snapMatrixToInt());

            var font = (Font)fontInterface;

            return(font.measureText(text, widthPIxels, renderMode));
        }