Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Commit

Permalink
try to resolve issue#24 - bug still exists
Browse files Browse the repository at this point in the history
  • Loading branch information
neophob committed Sep 18, 2012
1 parent 927c77f commit 70ea6a2
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/main/java/com/neophob/sematrix/output/gui/GeneratorGui.java
Expand Up @@ -74,7 +74,7 @@ public class GeneratorGui extends PApplet {
private static final Logger LOG = Logger.getLogger(GeneratorGui.class.getName()); private static final Logger LOG = Logger.getLogger(GeneratorGui.class.getName());


/** The y. */ /** The y. */
private int x,y; private int windowWidth,windowHeight;


/** The p image. */ /** The p image. */
private PImage pImage=null; private PImage pImage=null;
Expand Down Expand Up @@ -125,8 +125,8 @@ public class GeneratorGui extends PApplet {
* @param targetYSize the target y size * @param targetYSize the target y size
*/ */
public GeneratorGui(int x, int y, int targetXSize, int targetYSize) { public GeneratorGui(int x, int y, int targetXSize, int targetYSize) {
this.x = x; this.windowWidth = x;
this.y = y+SELECTED_MARKER; this.windowHeight = y+SELECTED_MARKER+100;
this.targetXSize = targetXSize; this.targetXSize = targetXSize;
this.targetYSize = targetYSize; this.targetYSize = targetYSize;
this.p5GuiYOffset = targetYSize + 80; this.p5GuiYOffset = targetYSize + 80;
Expand All @@ -141,8 +141,8 @@ public GeneratorGui(int x, int y, int targetXSize, int targetYSize) {
* @see processing.core.PApplet#setup() * @see processing.core.PApplet#setup()
*/ */
public void setup() { public void setup() {
LOG.log(Level.INFO, "create internal buffer with size "+x+"/"+y); LOG.log(Level.INFO, "create internal buffer with size "+windowWidth+"/"+windowHeight);
size(x,y+100); size(windowWidth,windowHeight);
noSmooth(); noSmooth();
frameRate(Collector.getInstance().getFps()); frameRate(Collector.getInstance().getFps());
background(0,0,0); background(0,0,0);
Expand Down Expand Up @@ -593,24 +593,30 @@ public void draw() {
} }







/** /**
* draw nice gradient at the end of the screen * draw nice gradient at the end of the screen
*/ */
private void drawGradientBackground() { private void drawGradientBackground() {
//there is an issue with this.height, it changes! //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();
} }




Expand Down

0 comments on commit 70ea6a2

Please sign in to comment.