internal void PushTranslate(float offsetX, float offsetY) { var matrix = new MatrixF(); matrix.Translate(offsetX, offsetY); _Push(matrix); }
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 }); }