@@ -95,7 +95,7 @@ public class PImage implements PConstants, Cloneable {
9595 public int [] pixels ;
9696
9797 /** 1 for most images, 2 for hi-dpi/retina */
98- public int pixelFactor ;
98+ public int pixelDensity = 1 ;
9999
100100 /** Actual dimensions of pixels array, taking into account the 2x setting. */
101101 public int pixelWidth ;
@@ -210,7 +210,7 @@ public class PImage implements PConstants, Cloneable {
210210 */
211211 public PImage () {
212212 format = ARGB ; // default to ARGB images for release 0116
213- pixelFactor = 1 ;
213+ pixelDensity = 1 ;
214214 }
215215
216216
@@ -266,10 +266,10 @@ public void init(int width, int height, int format, int factor) { // ignore
266266 this .width = width ;
267267 this .height = height ;
268268 this .format = format ;
269- this .pixelFactor = factor ;
269+ this .pixelDensity = factor ;
270270
271- pixelWidth = width * pixelFactor ;
272- pixelHeight = height * pixelFactor ;
271+ pixelWidth = width * pixelDensity ;
272+ pixelHeight = height * pixelDensity ;
273273 this .pixels = new int [pixelWidth * pixelHeight ];
274274 }
275275
@@ -330,7 +330,7 @@ public PImage(Image img) {
330330 pg .grabPixels ();
331331 } catch (InterruptedException e ) { }
332332 }
333- pixelFactor = 1 ;
333+ pixelDensity = 1 ;
334334 pixelWidth = width ;
335335 pixelHeight = height ;
336336 }
@@ -632,7 +632,7 @@ public void resize(int w, int h) { // ignore
632632 }
633633
634634 BufferedImage img =
635- shrinkImage ((BufferedImage ) getNative (), w *pixelFactor , h *pixelFactor );
635+ shrinkImage ((BufferedImage ) getNative (), w *pixelDensity , h *pixelDensity );
636636
637637 PImage temp = new PImage (img );
638638 this .pixelWidth = temp .width ;
@@ -641,8 +641,8 @@ public void resize(int w, int h) { // ignore
641641 // Get the resized pixel array
642642 this .pixels = temp .pixels ;
643643
644- this .width = pixelWidth / pixelFactor ;
645- this .height = pixelHeight / pixelFactor ;
644+ this .width = pixelWidth / pixelDensity ;
645+ this .height = pixelHeight / pixelDensity ;
646646
647647 // Mark the pixels array as altered
648648 updatePixels ();
@@ -858,9 +858,9 @@ public PImage get(int x, int y, int w, int h) {
858858 targetFormat = ARGB ;
859859 }
860860
861- PImage target = new PImage (targetWidth / pixelFactor ,
862- targetHeight / pixelFactor ,
863- targetFormat , pixelFactor );
861+ PImage target = new PImage (targetWidth / pixelDensity ,
862+ targetHeight / pixelDensity ,
863+ targetFormat , pixelDensity );
864864 target .parent = parent ; // parent may be null so can't use createImage()
865865 if (w > 0 && h > 0 ) {
866866 getImpl (x , y , w , h , target , targetX , targetY );
0 commit comments