Exemple #1
0
        internal void PushScale(float scaleX, float scaleY)
        {
            var matrix = new MatrixF();

            matrix.Scale(scaleX, scaleY);
            _Push(matrix);
        }
Exemple #2
0
        private void _OnRenderSizeChanged(float width, float height)
        {
            MakeSureCurrentContext(_context);

            _worldToNDC = new MatrixF();
            _worldToNDC.Translate(_origin.X, _origin.Y);
            _worldToNDC.Scale(2 / width, 2 / height);
            _worldToNDC.Translate(-1, -1);
            _viewWidth  = (int)(width * _transformToDevice.M11);
            _viewHeight = (int)(height * _transformToDevice.M22);

            Viewport(0, 0, _viewWidth, _viewHeight);

            // for dashed line
            _lineshader.Use();
            _lineshader.SetVec2("screenSize", 1, new float[] { width, height });

            // for dashed cicle and arc
            _arcshader.Use();
            _arcshader.SetVec2("screenSize", 1, new float[] { width, height });
        }