Skip to content

Commit

Permalink
Merge pull request FreeCAD#11144 from Roy-043/Draft-PlaneGui-some-min…
Browse files Browse the repository at this point in the history
…or-fixes

Draft: PlaneGui: some minor fixes
  • Loading branch information
Roy-043 authored Oct 22, 2023
2 parents 2b4ebc6 + 28593e4 commit 8636dd1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Mod/Draft/WorkingPlane.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,13 +1267,13 @@ def align_to_selection(self, offset=0, _hist_add=True):
shape, mtx, obj = objs[0]
place = FreeCAD.Placement(mtx)

if utils.get_type(obj) in ["App::Part",
"PartDesign::Plane",
"Axis",
"SectionPlane"]:
typ = utils.get_type(obj)
if typ in ["App::Part", "PartDesign::Plane", "Axis", "SectionPlane"]:
ret = self.align_to_obj_placement(obj, offset, place, _hist_add)
elif utils.get_type(obj) in ["WorkingPlaneProxy", "BuildingPart"]:
elif typ == "WorkingPlaneProxy":
ret = self.align_to_wp_proxy(obj, offset, place, _hist_add)
elif typ == "BuildingPart":
ret = self.align_to_wp_proxy(obj, offset, place * obj.Placement, _hist_add)
elif shape.isNull():
ret = self.align_to_obj_placement(obj, offset, place, _hist_add)
elif shape.ShapeType == "Face":
Expand Down Expand Up @@ -1692,13 +1692,13 @@ def _update_history(self):
if not self._history:
self._history = {"idx": 0, "data_list": [data]}
return
if data == self._history["data_list"][-1]:
idx = self._history["idx"]
if data == self._history["data_list"][idx]:
return
if self.auto is True and self._history["data_list"][-1]["auto"] is True:
if self.auto is True and self._history["data_list"][idx]["auto"] is True:
return

max_len = 10 # Max. length of data_list.
idx = self._history["idx"]
self._history["data_list"] = self._history["data_list"][(idx - (max_len - 2)):(idx + 1)]
self._history["data_list"].append(data)
self._history["idx"] = len(self._history["data_list"]) - 1
Expand Down

0 comments on commit 8636dd1

Please sign in to comment.