Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

try to resolve issue#24 - bug still exists

  • Loading branch information...
commit 70ea6a2d0e1963f5106bee747242916abf244d23 1 parent 927c77f
@neophob authored
Showing with 22 additions and 16 deletions.
  1. +22 −16 src/main/java/com/neophob/sematrix/output/gui/GeneratorGui.java
View
38 src/main/java/com/neophob/sematrix/output/gui/GeneratorGui.java
@@ -74,7 +74,7 @@
private static final Logger LOG = Logger.getLogger(GeneratorGui.class.getName());
/** The y. */
- private int x,y;
+ private int windowWidth,windowHeight;
/** The p image. */
private PImage pImage=null;
@@ -125,8 +125,8 @@
* @param targetYSize the target y size
*/
public GeneratorGui(int x, int y, int targetXSize, int targetYSize) {
- this.x = x;
- this.y = y+SELECTED_MARKER;
+ this.windowWidth = x;
+ this.windowHeight = y+SELECTED_MARKER+100;
this.targetXSize = targetXSize;
this.targetYSize = targetYSize;
this.p5GuiYOffset = targetYSize + 80;
@@ -141,8 +141,8 @@ public GeneratorGui(int x, int y, int targetXSize, int targetYSize) {
* @see processing.core.PApplet#setup()
*/
public void setup() {
- LOG.log(Level.INFO, "create internal buffer with size "+x+"/"+y);
- size(x,y+100);
+ LOG.log(Level.INFO, "create internal buffer with size "+windowWidth+"/"+windowHeight);
+ size(windowWidth,windowHeight);
noSmooth();
frameRate(Collector.getInstance().getFps());
background(0,0,0);
@@ -593,24 +593,30 @@ public void draw() {
}
-
/**
* draw nice gradient at the end of the screen
*/
private void drawGradientBackground() {
//there is an issue with this.height, it changes!
- int ofs=this.width*(424-255);//(this.height-255);
+
+ int ofs=windowWidth*(windowHeight-355);
+ //System.out.println(windowWidth+" "+windowHeight);
+
+ this.loadPixels();
+ try {
+ for (int yy=0; yy<255; yy++) {
+ int pink = color(yy/2, 128);
+ for (int xx=0; xx<windowWidth; xx++) {
+ this.pixels[ofs+xx] = pink;
+ }
+ ofs += windowWidth;
+ }
+ } catch (Exception e) {
+ LOG.log(Level.WARNING, "Failed to draw Gradient background "+ofs+": "+this.pixels.length);
+ }
+ this.updatePixels();
- this.loadPixels();
- for (int yy=0; yy<255; yy++) {
- int pink = color(yy/2, 128);
- for (int x=0; x<this.width; x++) {
- this.pixels[ofs+x] = pink;
- }
- ofs += this.width;
- }
- this.updatePixels();
}
Please sign in to comment.
Something went wrong with that request. Please try again.