From 0c36f880db6f2d8936f0212d95c20173712e498f Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 20 May 2013 22:07:20 +0200 Subject: [PATCH] [DEV] add the possibility to draw triangle with negative size --- sources/ewol/compositing/Drawing.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sources/ewol/compositing/Drawing.cpp b/sources/ewol/compositing/Drawing.cpp index fc06006f..50bda2dc 100644 --- a/sources/ewol/compositing/Drawing.cpp +++ b/sources/ewol/compositing/Drawing.cpp @@ -498,8 +498,20 @@ void ewol::Drawing::Rectangle(vec3 dest) */ float dxA = m_position.x(); float dxB = dest.x(); + if (dxA > dxB) { + // inverse order : + float tmp = dxA; + dxA = dxB; + dxB = tmp; + } float dyC = m_position.y(); float dyD = dest.y(); + if (dyC > dyD) { + // inverse order : + float tmp = dyC; + dyC = dyD; + dyD = tmp; + } if (true == m_clippingEnable) { if (dxA < m_clippingPosStart.x()) { dxA = m_clippingPosStart.x();