diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2013-01-13 11:44:19 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2013-01-13 11:44:19 (GMT) |
commit | 239e895826b2f843bc50cc6fef8108db174c33e8 (patch) | |
tree | d00bfd8e347fec51d3aa266d20c3545474d2e27d | |
parent | 5f7acf3fb6fd1fd24242ecdee241f439d33ec743 (diff) | |
download | fluxbox-239e895826b2f843bc50cc6fef8108db174c33e8.zip fluxbox-239e895826b2f843bc50cc6fef8108db174c33e8.tar.bz2 |
Ensure textures have the correct size bevor applying 'bevel'
-rw-r--r-- | src/FbTk/TextureRender.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc index ea126f5..511136e 100644 --- a/src/FbTk/TextureRender.cc +++ b/src/FbTk/TextureRender.cc | |||
@@ -779,25 +779,26 @@ Pixmap TextureRender::renderSolid(const FbTk::Texture &texture) { | |||
779 | 779 | ||
780 | if (texture.type() & Texture::INTERLACED) { | 780 | if (texture.type() & Texture::INTERLACED) { |
781 | lgc.setForeground(texture.colorTo()); | 781 | lgc.setForeground(texture.colorTo()); |
782 | register unsigned int i = 0; | 782 | unsigned int i; |
783 | for (; i < height; i += 2) | 783 | for (i = 0; i < height; i += 2) |
784 | pixmap.drawLine(lgc.gc(), 0, i, width - 1, i); | 784 | pixmap.drawLine(lgc.gc(), 0, i, width - 1, i); |
785 | 785 | ||
786 | } | 786 | } |
787 | 787 | ||
788 | lgc.setForeground(texture.loColor()); | 788 | lgc.setForeground(texture.loColor()); |
789 | 789 | ||
790 | if (texture.type() & Texture::BEVEL1) { | 790 | |
791 | if (height > 1 && width > 1 && texture.type() & Texture::BEVEL1) { | ||
791 | if (texture.type() & Texture::RAISED) { | 792 | if (texture.type() & Texture::RAISED) { |
792 | drawBevelRectangle(pixmap, lgc.gc(), hgc.gc(), 0, height - 1, width -1 , 0); | 793 | drawBevelRectangle(pixmap, lgc.gc(), hgc.gc(), 0, height - 1, width - 1, 0); |
793 | } else if (texture.type() & Texture::SUNKEN) { | 794 | } else if (texture.type() & Texture::SUNKEN) { |
794 | drawBevelRectangle(pixmap, hgc.gc(), lgc.gc(), 0, height - 1, width - 1, 0); | 795 | drawBevelRectangle(pixmap, hgc.gc(), lgc.gc(), 0, height - 1, width - 1, 0); |
795 | } | 796 | } |
796 | } else if (texture.type() & Texture::BEVEL2) { | 797 | } else if (width > 2 && height > 2 && texture.type() & Texture::BEVEL2) { |
797 | if (texture.type() & Texture::RAISED) { | 798 | if (texture.type() & Texture::RAISED) { |
798 | drawBevelRectangle(pixmap, lgc.gc(), hgc.gc(), 1, height - 3, width - 3, 1); | 799 | drawBevelRectangle(pixmap, lgc.gc(), hgc.gc(), 1, height - 2, width - 2, 1); |
799 | } else if (texture.type() & Texture::SUNKEN) { | 800 | } else if (texture.type() & Texture::SUNKEN) { |
800 | drawBevelRectangle(pixmap, hgc.gc(), lgc.gc(), 1, height - 3, width - 3, 1); | 801 | drawBevelRectangle(pixmap, hgc.gc(), lgc.gc(), 1, height - 2, width - 2, 1); |
801 | } | 802 | } |
802 | } | 803 | } |
803 | 804 | ||