Skip to content

Commit f93d70e

Browse files
author
piersh
committed
make rect geometry cache also depend on detail
1 parent 4bc9bb4 commit f93d70e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/webgl/primitives.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -815,13 +815,25 @@ p5.RendererGL.prototype.ellipse = function(args) {
815815

816816
p5.RendererGL.prototype.rect = function(args) {
817817
var perPixelLighting = this.attributes.perPixelLighting;
818-
var gId = 'rect|' + args[0] + '|' + args[1] + '|' + args[2] + '|' + args[3];
819818
var x = args[0];
820819
var y = args[1];
821820
var width = args[2];
822821
var height = args[3];
823822
var detailX = args[4] || (perPixelLighting ? 1 : 24);
824823
var detailY = args[5] || (perPixelLighting ? 1 : 16);
824+
var gId =
825+
'rect|' +
826+
x +
827+
'|' +
828+
y +
829+
'|' +
830+
width +
831+
'|' +
832+
height +
833+
'|' +
834+
detailX +
835+
'|' +
836+
detailY;
825837
if (!this.geometryInHash(gId)) {
826838
var _rect = function() {
827839
var u, v, p;

0 commit comments

Comments
 (0)