Le mer 27/08/2003 à 17:34, Dimitrie O. Paun a écrit : > On Wed, 27 Aug 2003 [EMAIL PROTECTED] wrote: ... > + if (lf.lfUnderline) { ... > + TSXDrawLine( gdi_display, physDev->drawable, physDev->gc, > + physDev->org.x + x, physDev->org.y + y + > linePos, > + physDev->org.x + x + width, physDev->org.y > + y + linePos ); ... > + if (lf.lfStrikeOut) { ... > + TSXDrawLine( gdi_display, physDev->drawable, physDev->gc, > + physDev->org.x + x, physDev->org.y + y - > linePos, > + physDev->org.x + x + width, physDev->org.y > + y - linePos ); > > What about we simplify this a bit: > > if (lf.lfUnderline || lf.lfStrikeOut) { > long linePos = (lf.lfUnderline ? tm.tmDescent / 2 : - tm.tmAscent / 3.5); > > TSXSetForeground( gdi_display, physDev->gc, physDev->textPixel ); > TSXSetLineAttributes( gdi_display, physDev->gc, lineWidth, > LineSolid, CapProjecting, JoinBevel ); > TSXDrawLine( gdi_display, physDev->drawable, physDev->gc, > physDev->org.x + x, physDev->org.y + y + linePos, > physDev->org.x + x + width, physDev->org.y + y + linePos ); > }
Not sure it'll do the same thing, it's +linePos in the first case and -linePos in the second... Vincent