Update fillTriangle to reduce unnecessary work