Re: General UI support
Rev 14095 replaces Sloth's earlier temp fix and I no longer get an error preventing a build. Looks good here. Thank you.
High Quality Resources for Collectible Card Games and Home of the CCGHQ Team
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=52&t=6354
// FLAG: SAVE OLD CLIP FOR RESET
Rectangle oldClipBounds = g2d0.getClipBounds();
// FLAG: CLIP THE MASK OUT OF GRAPHICS
clip = new Area(new RoundRectangle2D.Float(0, 0, pnlW, pnlH, cornerDiameter, cornerDiameter));
g2d0.setClip(clip);
// Texture tiling algorithm, no need to change this, is painted inside clip
this.tempX = 0;
this.tempY = 0;
while (this.tempX < this.pnlW) {
while (this.tempY < this.pnlH) {
g2d0.drawImage(this.backgroundTexture, (int) this.tempX, (int) this.tempY, null);
this.tempY += this.textureH;
}
this.tempX += this.textureW;
this.tempY = 0;
}
this.tempX = 0;
// End tiling algorithm
// FLAG:RESET TO OLD CLIP - NOT HAPPENING, OR SOMETHING
g2d0.setClip(oldClipBounds);
Thanks and yep, that's the rub, right theremoomarc wrote:Well, things are working on my side, but that doesn't help I guess seeing as I never had any of the issues.
Will have a look. I'm actually working on that section right now, trying to get the avatars to flow across the full area that's allowed them. (The 3-per-row thing is to accomodate the smallest screen setting without the dreaded horizontal scrollbar.)moomarc wrote:...avatars...
The problem is back, sorry Doublestrike. I will take a look at the code though.Doublestrike wrote:I have committed r14097 as a last gasp effort to fix this.
I don't know what it should look like, but when i remove the following part, i don't have problems anymore:Doublestrike wrote:I have committed r14097 as a last gasp effort to fix this. If a dev who is having troubles wanted to have a look at the problem, it's in FPanel$drawBackgroundTexture (around line 245) in forge.view.toolbox. The code looks like this (I've added extra comments, starting with FLAG for the parts to experiment with):If you can get this working without the repaint problem, the rest is finished. It's these few lines that are causing that trouble. So, if someone could play with this a bit, I would greatly appreciate it. If not, I'll just put square corners on everything.
- Code: Select all
// FLAG: SAVE OLD CLIP FOR RESET
Rectangle oldClipBounds = g2d0.getClipBounds();
// FLAG: CLIP THE MASK OUT OF GRAPHICS
clip = new Area(new RoundRectangle2D.Float(0, 0, pnlW, pnlH, cornerDiameter, cornerDiameter));
g2d0.setClip(clip);
// Texture tiling algorithm, no need to change this, is painted inside clip
this.tempX = 0;
this.tempY = 0;
while (this.tempX < this.pnlW) {
while (this.tempY < this.pnlH) {
g2d0.drawImage(this.backgroundTexture, (int) this.tempX, (int) this.tempY, null);
this.tempY += this.textureH;
}
this.tempX += this.textureW;
this.tempY = 0;
}
this.tempX = 0;
// End tiling algorithm
// FLAG:RESET TO OLD CLIP - NOT HAPPENING, OR SOMETHING
g2d0.setClip(oldClipBounds);
// FLAG: CLIP THE MASK OUT OF GRAPHICS
clip = new Area(new RoundRectangle2D.Float(0, 0, pnlW, pnlH, cornerDiameter, cornerDiameter));
g2d0.setClip(clip);g2d0.setClip(clip);g2d0.create().setClip(clip);I toyed around with the code and i find several versions that prevents the artifacts from appearing. Now i wonder what else could be wrong. Should the battlefield background image be visible?Chris H. wrote:just for the heck of it, I modified line 248 from:`
- Code: Select all
g2d0.setClip(clip);
to:`
- Code: Select all
g2d0.create().setClip(clip);
and it looks better, I get a similar result as the one from Sloth. Granted, the battlefield is missing the picture.
I'll add it to the avatars sprite. Look for it soon...slapshot5 wrote:What happened to the red-colored mage avatar we used to have for the computer? It's no an option on the Settings > Avatars panel.
-slapshot5
`Sloth wrote:I toyed around with the code and i find several versions that prevents the artifacts from appearing. Now i wonder what else could be wrong. Should the battlefield background image be visible?
`Sets the current clipping area to an arbitrary clip shape. Not all objects that implement the Shape interface can be used to set the clip. The only Shape objects that are guaranteed to be supported are Shape objects that are obtained via the getClip method and via Rectangle objects. This method sets the user clip, which is independent of the clipping associated with device bounds and window visibility.
Thanks fellas - that's exactly right. Currently, only the background texture should be drawn. If that's OK, then the same method can be applied elsewhere.Chris H. wrote:I do not think that the battleground image should be visible at this time. There are a few methods in this class that are not used locally at this time. It looks like drawForegroundScaled() might be responsible for drawing the image.
Actually, g2d0 is already created from the root graphics, so that would be introducing another graphics canvas, just so you know (performance!). But that may be the only way to solve the problem...Chris H wrote:g2d0.create().setClip(clip);
Was re-reading this - do these versions have rounded corners? That's the whole problem here.Sloth wrote:I toyed around with the code and i find several versions that prevents the artifacts from appearing. Now i wonder what else could be wrong. Should the battlefield background image be visible?
`Doublestrike wrote:Actually, g2d0 is already created from the root graphics, so that would be introducing another graphics canvas, just so you know (performance!). But that may be the only way to solve the problem...