Skip to content

Commit

Permalink
*Fixed issue #113
Browse files Browse the repository at this point in the history
*Updated version to 2.1.1
  • Loading branch information
carloBarazzetta committed Sep 16, 2020
1 parent c7721ca commit 70a618b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions Packages/SVGIconImageListEditorUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,11 @@ procedure TSVGIconImageListEditor.BuildList(Selected: Integer);
procedure TSVGIconImageListEditor.DeleteSelectedItems;
var
LIndex: Integer;
Selected: Integer;
LSelectedImageIndex: Integer;
begin
Screen.Cursor := crHourGlass;
try
Selected := ImageView.ItemIndex;
LSelectedImageIndex := ImageView.Items[ImageView.ItemIndex].ImageIndex;
FEditingList.BeginUpdate;
try
for LIndex := ImageView.Items.Count - 1 downto 0 do
Expand All @@ -705,7 +705,7 @@ procedure TSVGIconImageListEditor.DeleteSelectedItems;
FEditingList.EndUpdate;
end;
FChanged := True;
BuildList(Selected);
BuildList(LSelectedImageIndex);
finally
Screen.Cursor := crDefault;
end;
Expand All @@ -718,18 +718,17 @@ procedure TSVGIconImageListEditor.DeleteAllButtonClick(Sender: TObject);

procedure TSVGIconImageListEditor.DeleteButtonClick(Sender: TObject);
var
LIndex: Integer;
LSelectedImageIndex: Integer;
begin
FEditingList.BeginUpdate;
try
LIndex := ImageView.ItemIndex;
FEditingList.SVGIconItems.Delete(ImageView.Items[LIndex].ImageIndex);
LSelectedImageIndex := ImageView.Items[ImageView.ItemIndex].ImageIndex;
FEditingList.SVGIconItems.Delete(ImageView.Items[ImageView.ItemIndex].ImageIndex);
finally
FEditingList.EndUpdate;
end;
FChanged := True;
if ImageView.Items.Count > 1 then
BuildList(ImageView.Items[LIndex-1].ImageIndex);
BuildList(LSelectedImageIndex);
end;

procedure TSVGIconImageListEditor.FixedColorComboBoxSelect(Sender: TObject);
Expand Down
2 changes: 1 addition & 1 deletion Source/D2DSVGFactory.pas
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ procedure TD2DSVG.SetFixedColor(const Color: TColor);
fFixedColor := Color;

fGrayScale := False;
if FFixedColor <> TColors.SysDefault then
if (FFixedColor <> TColors.SysDefault) and Assigned(fSvgDoc) then
begin
fSvgDoc.GetRoot(Root);

Expand Down
2 changes: 1 addition & 1 deletion Source/SVGIconImageListBase.pas
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interface
SvgInterfaces;

const
SVGIconImageListVersion = '2.1.0';
SVGIconImageListVersion = '2.1.1';
DEFAULT_SIZE = 16;

type
Expand Down

0 comments on commit 70a618b

Please sign in to comment.