aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/FbPixmap.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-07-05 23:51:57 (GMT)
committerfluxgen <fluxgen>2004-07-05 23:51:57 (GMT)
commit7c85d11a950cf88ce53cf15e6d4f21c3433fd24d (patch)
tree63239383f7f78e20812790d4f0f091be7a7cdc76 /src/FbTk/FbPixmap.cc
parentdf570bc9452b24e963c38591cfcb185eb70a8a38 (diff)
downloadfluxbox-7c85d11a950cf88ce53cf15e6d4f21c3433fd24d.zip
fluxbox-7c85d11a950cf88ce53cf15e6d4f21c3433fd24d.tar.bz2
tiled pixmap fix, patch from dhx (xyx@gm...), see mailing list
Diffstat (limited to 'src/FbTk/FbPixmap.cc')
-rw-r--r--src/FbTk/FbPixmap.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc
index bbc8fcb..cac6cf0 100644
--- a/src/FbTk/FbPixmap.cc
+++ b/src/FbTk/FbPixmap.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbPixmap.cc,v 1.10 2004/01/11 12:48:46 fluxgen Exp $ 22// $Id: FbPixmap.cc,v 1.11 2004/07/05 23:51:57 fluxgen Exp $
23 23
24#include "FbPixmap.hh" 24#include "FbPixmap.hh"
25#include "App.hh" 25#include "App.hh"
@@ -248,6 +248,28 @@ void FbPixmap::scale(unsigned int dest_width, unsigned int dest_height) {
248 m_pm = new_pm.release(); 248 m_pm = new_pm.release();
249} 249}
250 250
251void FbPixmap::tile(unsigned int dest_width, unsigned int dest_height) {
252 if (drawable() == 0 ||
253 (dest_width == width() && dest_height == height()))
254 return;
255
256 Display *dpy = FbTk::App::instance()->display();
257
258 FbPixmap new_pm(drawable(), width(), height(), depth());
259
260 new_pm.copy(m_pm);
261
262 resize(dest_width,dest_height);
263
264 GC gc = XCreateGC(dpy, drawable(), 0, NULL);
265
266 XSetTile(dpy,gc,new_pm.release());
267 XSetFillStyle(dpy, gc, FillTiled);
268 XFillRectangle(dpy,drawable(),gc, 0, 0, dest_width, dest_height);
269}
270
271
272
251void FbPixmap::resize(unsigned int width, unsigned int height) { 273void FbPixmap::resize(unsigned int width, unsigned int height) {
252 FbPixmap pm(drawable(), width, height, depth()); 274 FbPixmap pm(drawable(), width, height, depth());
253 *this = pm.release(); 275 *this = pm.release();