anchor.diff:    ObjIndex: Integer;
   begin
     case TKMButtonFlat(Sender).Tag of
  -    OBJ_BLOCK,
  -    OBJ_NONE:  ObjIndex := TKMButtonFlat(Sender).Tag; // Block or Erase
  -    else       ObjIndex := ObjectsScroll.Position * 3 + TKMButtonFlat(Sender).Tag; //0..n-1
  +    OBJ_BLOCK_TAG,
  +    OBJ_NONE_TAG:  ObjIndex := TKMButtonFlat(Sender).Tag; // Block or Erase
  +    else           ObjIndex := ObjectsScroll.Position * 3 + TKMButtonFlat(Sender).Tag; //0..n-1
     end;
   
     ObjectsUpdate(ObjIndex);
   
     // Update Objects Palette scroll position
  -  if not (ObjIndex in [OBJ_BLOCK, OBJ_NONE])
  +  if (ObjIndex <> OBJ_BLOCK_TAG) and (ObjIndex <> OBJ_NONE_TAG)
       and not InRange(ObjIndex,
                       Scroll_ObjectsPalette.Position*fObjPaletteTableSize.X,
                       Scroll_ObjectsPalette.Position*fObjPaletteTableSize.X + fObjPaletteTableSize.X*fObjPaletteTableSize.Y - 1) then
  
positive.code:     end;
    ObjectErase := TKMButtonFlat.Create(Panel_Objects, 9, 4, 32, 32, 340);
    ObjectErase.Hint := GetHintWHotkey(TX_MAPED_TERRAIN_OBJECTS_REMOVE, SC_MAPEDIT_SUB_MENU_ACTION_1);
    ObjectErase.Tag := OBJ_NONE; //no object
    ObjectErase.OnClick := ObjectsChange;
  
    ObjectBlock := TKMButtonFlat.Create(Panel_Objects, TB_MAP_ED_WIDTH-32, 4, 32, 32, 254,rxTrees);
    ObjectBlock.Hint := GetHintWHotkey(TX_MAPED_TERRAIN_OBJECTS_BLOCK, SC_MAPEDIT_SUB_MENU_ACTION_2);
    ObjectBlock.Tag := OBJ_BLOCK; //block object
    ObjectBlock.OnClick := ObjectsChange;
  
    ObjectsPalette_Button := TKMButtonFlat.Create(Panel_Objects, 7, 320, TB_MAP_ED_WIDTH - 7, 21, 0);
  
negative.code: begin
    fCountCompact := 0;
    for I := 0 to gRes.MapElements.Count - 1 do
      if (I <> OBJ_BLOCK_TAG) and (gMapElements[I].Anim.Count > 0) and (gMapElements[I].Anim.Step[1] > 0)
        and (gMapElements[I].Stump = -1) then //Hide falling trees and invisible wall (61)
      begin
        fCompactToMapElem[fCountCompact] := I; //pointer
  