# HG changeset patch # User Jason Maltzen # Date 2019-11-02 13:14:29 # Node ID ce4fe2190a1258918a2867fb64bab0da47b3612e # Parent 30f42dd362990d84c34ee40b30e347a31701ffd0 Fix another bug in computing the swatch area diff --git a/ReactionRecorder.cs b/ReactionRecorder.cs --- a/ReactionRecorder.cs +++ b/ReactionRecorder.cs @@ -313,9 +313,9 @@ namespace DesertPaintLab bool result = true; - int solidUpperLeft = testPixelStart + ((y+2) * stride) + ((x+2) * 3); - int solidLowerLeft = testPixelStart + ((swatchHeight - 4) * stride); - int solidUpperRight = testPixelStart + ((swatchWidth - 4) * 3); + int solidUpperLeft = testPixelStart + (2 * stride) + (2 * 3); + int solidLowerLeft = solidUpperLeft + ((swatchHeight - 4) * stride); + int solidUpperRight = solidUpperLeft + ((swatchWidth - 4) * 3); int solidLowerRight = solidLowerLeft + ((swatchWidth - 4) * 3); byte swatch_r = pixBytes[solidUpperLeft]; byte swatch_g = pixBytes[solidUpperLeft + 1];