ecere/gfx/LFBDisplayDriver: Fixed up outlines
[sdk] / ecere / src / gfx / drivers / LFBDisplayDriver.ec
index c0a1ffb..04d7d68 100644 (file)
@@ -74,7 +74,7 @@ static void ComputeOutline(byte *out, byte *src, uint w, uint h, float size, flo
    float inv_rw = 1/(rb-ra);
 
    for(i = 0; i < numPixels; i++)
-      data[i] = src[i] / 255;
+      data[i] = src[i] / 255.0f;
 
    computegradient(data, w, h, gx, gy);
    edtaa3(data, gx, gy, w, h, distx, disty, dist);
@@ -768,8 +768,8 @@ class GlyphPack : BTNode
          int y1 = (timesBigger*pCellHeight - pCellHeight) / 2,  y2 = y1 + pCellHeight-1;
          ox = -Max(0, x1 - minX1);
          oy = -Max(0, y1 - minY1);
-         cellWidth  = pCellWidth  - ox + Max(0, maxX2 - x2);
-         cellHeight = pCellHeight - oy + Max(0, maxY2 - y2);
+         cellWidth  = pCellWidth  - ox + Max(0, (maxX2 > x2) ? (maxX2 - x2) : 0);
+         cellHeight = pCellHeight - oy + Max(0, (maxY2 > y2) ? (maxY2 - y2) : 0);
       }
 
       width = cellWidth * 16;
@@ -841,7 +841,7 @@ class GlyphPack : BTNode
             if(flags)
                strcat(fileName, "Bold");
             */
-            sprintf(fileName, "font%d", fid++);
+            sprintf(fileName, "outline%d", fid++);
             ChangeExtension(fileName, "pcx", fileName);
 
             outline.bitmap.Save(fileName, null, 0);