From d08ae0dd668179afe4585a0d50760f2d16b3ba45 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 6 Oct 2018 15:01:12 +0900 Subject: [PATCH] graphicsutil: Fix comments --- internal/graphicsutil/vertices.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/graphicsutil/vertices.go b/internal/graphicsutil/vertices.go index dd79f8ec6..cae64b097 100644 --- a/internal/graphicsutil/vertices.go +++ b/internal/graphicsutil/vertices.go @@ -147,8 +147,10 @@ func Vertex(width, height int, dx, dy, sx, sy float32, cr, cg, cb, ca float32) [ wf := float32(width) hf := float32(height) - // Specifying a range explicitly here is redundant but this helps optimization - // to eliminate boundry checks. + // Specify -1 for the source region, which means the source region is ignored. + // + // NaN would make more sense to represent an invalid state, but vertices including NaN values doesn't work on + // some machines (#696). Let's use negative numbers to represent such state. vs := theVerticesBackend.sliceForOneQuad()[0:10] vs[0] = dx vs[1] = dy