Browse Source

+ Patch from Colin Western for case sensitive color codes

michael 21 years ago
parent
commit
2995d4ec4d
1 changed files with 6 additions and 2 deletions
  1. 6 2
      fcl/image/fpreadxpm.pp

+ 6 - 2
fcl/image/fpreadxpm.pp

@@ -268,8 +268,12 @@ var l : TStringList;
       begin
       code := copy(s, p, cpp);
       inc(p,cpp);
-      color := Palette.indexof (code);
-      img.pixels[r-1,imgindex] := color;
+      for color := 0 to Palette.Count-1 do
+        { Can't use indexof, as compare must be case sensitive }
+        if code = Palette[color] then begin
+          img.pixels[r-1,imgindex] := color;
+          Break;
+        end;
       end;
   end;