summaryrefslogtreecommitdiff
path: root/vcl/opengl/LineRenderUtils.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-06-21 12:14:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-25 13:53:21 +0200
commit4583911575edf98ccd5b15af8eafa6a3a7b64034 (patch)
treef3f33e53c45dd870f19e7e42db9bb5b4bf1f23bf /vcl/opengl/LineRenderUtils.cxx
parent1942182a3d1817bc539229d7fda3af69f7e295b8 (diff)
improve loplugin:simplifyconstruct
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/opengl/LineRenderUtils.cxx')
-rw-r--r--vcl/opengl/LineRenderUtils.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/opengl/LineRenderUtils.cxx b/vcl/opengl/LineRenderUtils.cxx
index 61d0dc38457c..e130fb93bb22 100644
--- a/vcl/opengl/LineRenderUtils.cxx
+++ b/vcl/opengl/LineRenderUtils.cxx
@@ -121,8 +121,8 @@ void LineBuilder::appendBevelJoint(glm::vec2 const& point, const glm::vec2& prev
// All the magic is done by the fact that we draw triangle strips, so we
// cover the joins correctly.
- glm::vec2 prevNormal = glm::vec2(-prevLineVector.y, prevLineVector.x);
- glm::vec2 nextNormal = glm::vec2(-nextLineVector.y, nextLineVector.x);
+ glm::vec2 prevNormal(-prevLineVector.y, prevLineVector.x);
+ glm::vec2 nextNormal(-nextLineVector.y, nextLineVector.x);
appendAndConnectLinePoint(point, prevNormal, 1.0f);
appendAndConnectLinePoint(point, nextNormal, 1.0f);
@@ -139,8 +139,8 @@ void LineBuilder::appendRoundJoint(glm::vec2 const& point, const glm::vec2& prev
// line joins look round. Ideally the number of vectors could be
// calculated.
- glm::vec2 prevNormal = glm::vec2(-prevLineVector.y, prevLineVector.x);
- glm::vec2 nextNormal = glm::vec2(-nextLineVector.y, nextLineVector.x);
+ glm::vec2 prevNormal(-prevLineVector.y, prevLineVector.x);
+ glm::vec2 nextNormal(-nextLineVector.y, nextLineVector.x);
glm::vec2 middle = vcl::vertex::normalize(prevNormal + nextNormal);
glm::vec2 middleLeft = vcl::vertex::normalize(prevNormal + middle);
@@ -158,7 +158,7 @@ void LineBuilder::appendRoundLineCapVertices(const glm::vec2& rPoint1, const glm
constexpr int nRoundCapIteration = 12;
glm::vec2 lineVector = vcl::vertex::normalize(rPoint2 - rPoint1);
- glm::vec2 normal = glm::vec2(-lineVector.y, lineVector.x);
+ glm::vec2 normal(-lineVector.y, lineVector.x);
glm::vec2 previousRoundNormal = normal;
for (int nFactor = 1; nFactor <= nRoundCapIteration; nFactor++)
@@ -176,7 +176,7 @@ void LineBuilder::appendRoundLineCapVertices(const glm::vec2& rPoint1, const glm
void LineBuilder::appendSquareLineCapVertices(const glm::vec2& rPoint1, const glm::vec2& rPoint2)
{
glm::vec2 lineVector = vcl::vertex::normalize(rPoint2 - rPoint1);
- glm::vec2 normal = glm::vec2(-lineVector.y, lineVector.x);
+ glm::vec2 normal(-lineVector.y, lineVector.x);
glm::vec2 extrudedPoint = rPoint1 + -lineVector * (mfLineWidth / 2.0f);