aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2001-12-16 23:19:57 (GMT)
committerfluxgen <fluxgen>2001-12-16 23:19:57 (GMT)
commitee3bb66472216c9cfa55055cb30d4c61db0688d4 (patch)
treefe8c1284d768aa0debfeba2d8c6c217f4da0d79f
parentd2a439ccdd740e42ebae70373a31ffe1f6dcced0 (diff)
downloadfluxbox_paul-ee3bb66472216c9cfa55055cb30d4c61db0688d4.zip
fluxbox_paul-ee3bb66472216c9cfa55055cb30d4c61db0688d4.tar.bz2
Fixed vertical draw
-rw-r--r--src/misc.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/misc.cc b/src/misc.cc
index 28a63e3..37e2580 100644
--- a/src/misc.cc
+++ b/src/misc.cc
@@ -91,7 +91,8 @@ Misc::XRotFontStruct *Misc::XRotLoadFont(Display *dpy, char *fontname, float ang
91 XSetFont(dpy, font_gc, fontstruct->fid); 91 XSetFont(dpy, font_gc, fontstruct->fid);
92 92
93 /* allocate space for rotated font ... */ 93 /* allocate space for rotated font ... */
94 rotfont = new XRotFontStruct; 94 rotfont = (XRotFontStruct *)malloc((unsigned)sizeof(XRotFontStruct));
95
95 if (rotfont == 0) { 96 if (rotfont == 0) {
96 cerr<<"Fluxbox::Misc: out of memory"<<endl; 97 cerr<<"Fluxbox::Misc: out of memory"<<endl;
97 return 0; 98 return 0;
@@ -158,8 +159,8 @@ Misc::XRotFontStruct *Misc::XRotLoadFont(Display *dpy, char *fontname, float ang
158 boxlen/2 - descent, text, 1); 159 boxlen/2 - descent, text, 1);
159 160
160 /* reserve memory for first XImage ... */ 161 /* reserve memory for first XImage ... */
161 vertdata = new unsigned char[vert_len*vert_h]; //(unsigned char *) malloc((unsigned)(vert_len*vert_h)); 162 vertdata = (unsigned char *) malloc((unsigned)(vert_len*vert_h));
162 163
163 /* create the XImage ... */ 164 /* create the XImage ... */
164 I1 = XCreateImage(dpy, DefaultVisual(dpy, screen), 1, XYBitmap, 165 I1 = XCreateImage(dpy, DefaultVisual(dpy, screen), 1, XYBitmap,
165 0, (char *)vertdata, vert_w, vert_h, 8, 0); 166 0, (char *)vertdata, vert_w, vert_h, 8, 0);
@@ -192,7 +193,7 @@ Misc::XRotFontStruct *Misc::XRotLoadFont(Display *dpy, char *fontname, float ang
192 rotfont->per_char[ichar-32].glyph.bit_h = bit_h; 193 rotfont->per_char[ichar-32].glyph.bit_h = bit_h;
193 194
194 /* reserve memory for the rotated image ... */ 195 /* reserve memory for the rotated image ... */
195 bitdata = new unsigned char[bit_h*bit_len]; //(unsigned char *)calloc((unsigned)(bit_h*bit_len), 1); 196 bitdata = (unsigned char *)calloc((unsigned)(bit_h*bit_len), 1);
196 197
197 /* create the image ... */ 198 /* create the image ... */
198 I2 = XCreateImage(dpy, DefaultVisual(dpy, screen), 1, XYBitmap, 0, 199 I2 = XCreateImage(dpy, DefaultVisual(dpy, screen), 1, XYBitmap, 0,
@@ -267,8 +268,8 @@ void Misc::XRotUnloadFont(Display *dpy, XRotFontStruct *rotfont)
267 XFreePixmap(dpy, rotfont->per_char[ichar].glyph.bm); 268 XFreePixmap(dpy, rotfont->per_char[ichar].glyph.bm);
268 } 269 }
269 270
270 delete rotfont->name; 271 free((char *)rotfont->name);
271 delete rotfont; 272 free((char *)rotfont);
272} 273}
273 274
274//------- XRotTextWidth ------------------ 275//------- XRotTextWidth ------------------