[core] Update icon shader code

Ported the following patch:
- [convert mat4 exMatrix to a vec2 extrudeScale](a8d549b7a4)
This commit is contained in:
Bruno de Oliveira Abinader
2016-05-31 19:59:50 +03:00
parent 64f4be635b
commit 5e7736ce87
4 changed files with 21 additions and 34 deletions

View File

@@ -100,7 +100,9 @@ void Painter::render(const Style& style, const FrameData& frame_, SpriteAtlas& a
// The extrusion matrix.
matrix::ortho(extrudeMatrix, 0, state.getWidth(), state.getHeight(), 0, 0, -1);
extrudeScale = {{ (2.0f / state.getWidth()) * state.getAltitude(), -2.0f / state.getHeight() * state.getAltitude() }};
const float flippedY = state.getViewportMode() == ViewportMode::FlippedY;
extrudeScale = {{ 2.0f / state.getWidth() * state.getAltitude(),
(flippedY ? 2.0f : -2.0f) / state.getHeight() * state.getAltitude() }};
// The native matrix is a 1:1 matrix that paints the coordinates at the
// same screen position as the vertex specifies.