Floating point color values in palette now are rounded to integer values, instead of throwing an error.
This commit is contained in:
parent
9510e8daee
commit
df417be289
@ -42,7 +42,7 @@ const
|
|||||||
RS_XO = 2;
|
RS_XO = 2;
|
||||||
RS_VO = 3;
|
RS_VO = 3;
|
||||||
|
|
||||||
AppVersionString = 'Apophysis 2.06 beta';
|
AppVersionString = 'Apophysis 2.06c beta';
|
||||||
|
|
||||||
type
|
type
|
||||||
TMouseMoveState = (msUsual, msZoomWindow, msZoomOutWindow, msZoomWindowMove,
|
TMouseMoveState = (msUsual, msZoomWindow, msZoomOutWindow, msZoomWindowMove,
|
||||||
@ -2847,6 +2847,7 @@ var
|
|||||||
EntryStrings, Tokens: TStringList;
|
EntryStrings, Tokens: TStringList;
|
||||||
SavedPal: Boolean;
|
SavedPal: Boolean;
|
||||||
i, j: integer;
|
i, j: integer;
|
||||||
|
floatcolor: double;
|
||||||
s: string;
|
s: string;
|
||||||
Palette: TcolorMap;
|
Palette: TcolorMap;
|
||||||
begin
|
begin
|
||||||
@ -2906,9 +2907,12 @@ begin
|
|||||||
for j := 0 to 255 do begin
|
for j := 0 to 255 do begin
|
||||||
s := FStrings[i];
|
s := FStrings[i];
|
||||||
GetTokens(s, tokens);
|
GetTokens(s, tokens);
|
||||||
Palette[j][0] := StrToInt(Tokens[0]);
|
floatcolor := StrToFloat(Tokens[0]);
|
||||||
Palette[j][1] := StrToInt(Tokens[1]);
|
Palette[j][0] := round(floatcolor);
|
||||||
Palette[j][2] := StrToInt(Tokens[2]);
|
floatcolor := StrToFloat(Tokens[1]);
|
||||||
|
Palette[j][1] := round(floatcolor);
|
||||||
|
floatcolor := StrToFloat(Tokens[2]);
|
||||||
|
Palette[j][2] := round(floatcolor);
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -4183,7 +4187,7 @@ procedure TMainForm.XMLScannerEmptyTag(Sender: TObject; TagName: string;
|
|||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
v: string;
|
v: string;
|
||||||
d: double;
|
d, floatcolor: double;
|
||||||
Tokens: TStringList;
|
Tokens: TStringList;
|
||||||
begin
|
begin
|
||||||
Tokens := TStringList.Create;
|
Tokens := TStringList.Create;
|
||||||
@ -4282,9 +4286,12 @@ begin
|
|||||||
i := StrToInt(Attributes.value('index'));
|
i := StrToInt(Attributes.value('index'));
|
||||||
v := Attributes.value('rgb');
|
v := Attributes.value('rgb');
|
||||||
GetTokens(v, tokens);
|
GetTokens(v, tokens);
|
||||||
Parsecp.cmap[i][0] := StrToInt(Tokens[0]);
|
floatcolor := StrToFloat(Tokens[0]);
|
||||||
Parsecp.cmap[i][1] := StrToInt(Tokens[1]);
|
Parsecp.cmap[i][0] := round(floatcolor);
|
||||||
Parsecp.cmap[i][2] := StrToInt(Tokens[2]);
|
floatcolor := StrToFloat(Tokens[1]);
|
||||||
|
Parsecp.cmap[i][1] := round(floatcolor);
|
||||||
|
floatcolor := StrToFloat(Tokens[2]);
|
||||||
|
Parsecp.cmap[i][2] := round(floatcolor);
|
||||||
end;
|
end;
|
||||||
if TagName = 'colors' then
|
if TagName = 'colors' then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user