Commit Graph

292 Commits

Author SHA1 Message Date
marioalexis
da2195a04a Draft: Fix variable referenced before assignment 2021-09-06 01:14:14 -03:00
Yorik van Havre
4633ef67d2 Merge pull request #4891 from Roy-043/Draft_Fix_Misplaced_Edit_Nodes_BezCurve_2
Draft: Fix misplaced Draft_Edit nodes for BezCurve 2nd version
2021-09-02 11:41:51 +02:00
Yorik van Havre
c2dbd1cead Merge pull request #4907 from Roy-043/Draft_fix_move_alt_copy_mode
Draft: Fix Draft_Move Alt copy mode
2021-09-02 11:41:07 +02:00
Yorik van Havre
e59e9d09d6 Merge pull request #4915 from carlopav/draft_snap_nodoc_fix
Draft: fixed Snap behaviour when no document is active.
2021-08-30 14:26:10 +02:00
carlopav
a3d5427543 Update src/Mod/Draft/draftguitools/gui_snaps.py
Co-authored-by: Yorik van Havre <yorik.vanhavre@gmail.com>
2021-08-30 13:57:04 +02:00
Yorik van Havre
fc8d786cb7 Merge pull request #4905 from Roy-043/Draft_fix_trimex_wrong_units
Draft: Draft_Trimex: Fix wrong angle units in task panel
2021-08-16 16:22:47 +02:00
Yorik van Havre
cf4d2bd8d7 Draft: Allow to stretch more complex Arch objects 2021-08-03 16:45:43 +02:00
Yorik van Havre
24edde89a3 Merge pull request #4927 from marioalexis84/draft-restore
Draft: Fix regression on WP and fixes #0004562
2021-08-02 15:52:42 +02:00
Yorik van Havre
099f7bf03a Merge pull request #4929 from marioalexis84/draft-multiselection
Draft: Enable multiple selection for dumb task dialog in Modification commands
2021-08-02 15:51:10 +02:00
Yorik van Havre
4422a1feb0 Merge branch 'master' into Draft_Fix_Draft_SetStyle 2021-08-02 11:55:28 +02:00
Yorik van Havre
d2aa803cc3 Merge pull request #4879 from Roy-043/Draft_Fix_Layer_List_Issues
Draft: Fix 3 issues with the Draft Tray layer list
2021-08-02 11:54:11 +02:00
Roy-043
23f3df1303 Draft: Fixed wrong cmd names in gui_planeproxy.py
Draft_SetWorkingPlaneProxy should be Draft_WorkingPlaneProxy
2021-08-01 13:14:30 +02:00
Roy-043
20aaecf4f3 Draft: fix gui_offset.py wrong ghost if start angle of arc is larger
The ghost of an arc with a start angle that is larger than the end angle would be wrong.
2021-07-31 09:56:25 +02:00
Roy-043
1d439ce0a6 Draft: Fix spelling gui_edit_draft_objects.py
"mset first angle" should be "set first angle".
2021-07-31 09:53:56 +02:00
marioalexis
b25b7f142d Draft: Enable multiple selection for dumb task dialog in Modification commands 2021-07-19 02:45:17 -03:00
marioalexis
23e92e038b Draft: Save last WP used 2021-07-18 02:07:59 -03:00
marioalexis
1b7a703519 Draft: Fix regression generated in commit d3595bf 2021-07-18 02:07:08 -03:00
carlopav
522a1da541 Draft: fixed Snap behaviour when no document is active.
Draft toolbar and statusbar can be activated also when no document is active, because Snap is not related to active document.
2021-07-11 10:09:46 +02:00
Roy-043
cc84e2a0fb Draft: Fix Draft_Move Alt copy mode
Draft_Move Alt copy mode was fixed. The modifications were taken from gui_rotate.py.
2021-07-04 10:22:54 +02:00
Roy-043
b10a559fb2 Draft: Draft_Trimex: Fix wrong angle units in taskpanel
The redraw function was changed to return a list [dist, ang] if the real argument is not True. With this list the action function 'knows' which units to display. This also made it possible to move the "self.ui." related stuff that was in the redraw function to the the action function.
I have also changed to tooltip texts by removing the article "The". This more in keeping with other tooltips.
2021-07-02 11:32:51 +02:00
Yorik van Havre
2c641ca4ec Draft: Added Text Spacing and Line Spacing settings to Draft Set Style dialog 2021-07-01 12:59:49 +02:00
Yorik van Havre
2c074af17e Merge pull request #4492 from marioalexis84/draft-wp_restore
Draft: Fixes #0004562: Active working plane changes when I close Draft Edit panel
2021-06-30 10:50:25 +02:00
Roy-043
a7513591ae Draft: Fix misplaced Draft_Edit nodes for BezCurve 2nd version
The poles in the resetTrackersBezier function are in the CS of the geometric parent of the curve. Before using `p = obj.getGlobalPlacement().multVec(p)` the nodes have to be translated to the CS of the curve. Otherwise the effects of the curve's Placement would be added twice. See discussion: https://github.com/FreeCAD/FreeCAD/pull/4889



 the global coordinate system. They should therefore not be translated from the LCS to the GCS.
2021-06-26 09:42:56 +02:00
Yorik van Havre
27ede668e8 Draft: Fixed construction group name 2021-06-22 12:38:22 +02:00
Roy-043
df04ca61d1 Draft: Fix wrong color format in gui_setstyle.py 2021-06-21 22:46:00 +02:00
Roy-043
5334f6c60d Fix 3 issues with the Draft Tray layer list
Fix 3 issues with the Draft Tray layer list:
The layer list should display even if there are no layers so that the "Add new Layer" option can be selected.
"Project" and "BuildingPart" objects should be added to the list (depending on "AutogroupAddGroups" of course).
The "LayerContainer" object should not be added to the list. Although it is in fact a group, it is just too confusing.
2021-06-21 21:11:52 +02:00
luz paz
19080b58b3 Fix source comment typos
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,bottome,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,ontop,orgin,orginx,orginy,ot,pard,parms,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/doc/SourceDocu`
2021-06-10 17:33:40 -04:00
Yorik van Havre
3317cf384d Merge pull request #4833 from carlopav/draft-fix-autogroup
Draft: fix Autogroup to fix Draft_OrthoArray crash when using active Std_Part.
2021-06-09 12:44:42 +02:00
marioalexis
6f101761bb Draft: Improve alignToSelection method on WorkingPlane 2021-06-06 21:30:20 -03:00
carlopav
45aa103dd4 Draft: Autogroup, insert guard to prevent cyclic references
ref. Forum discussion: Draft_OrthoArray: Crash when using active Std_Part. https://forum.freecadweb.org/viewtopic.php?f=23&t=59155&p=508132#p508132

Autogroup try to add new created Draft Objects into the active Part, but if the Part is used as a Base for the new object this could create a cyclic reference. 
This behaviour is prevented by adding a check for " obj in active_part.InListRecursive"
2021-06-06 11:21:21 +02:00
Yorik van Havre
1292398d9a Merge pull request #4827 from Roy-043/Draft_Fix_gui_stretch
Draft: Fix gui_stretch
2021-06-04 13:18:05 +02:00
Yorik van Havre
692789bcfe Merge pull request #4816 from luzpaz/typos
Fix misc. typos
2021-06-04 13:16:21 +02:00
luz paz
0f0c79c827 Arch: fix typo in translate() 2021-06-03 14:36:21 -04:00
Roy-043
64ee9f335c Draft: Fix gui_stretch
If a wire is created to replace a rectangle, the MakeFace property of the wire should match that of the rectangle.
2021-06-02 14:28:56 +02:00
carlopav
cdb3a1d7fd Draft: Edit, cleanup of new GuiTools.addPoint methods
In new splitted addPoint methods, getObjectsInfo and the consequent checks have been removed and moved to main DraftEdit module in a new get_specific_object_info method.
This method returns the info for the selected object at a given position and the 3d Vector of the point clicked on the object.
2021-06-01 23:21:12 +02:00
carlopav
d2d570f875 Draft: Edit, moved resetTrackers for context menu actions to main module
The wrapper allows to call resetTrackers in the main module after the callback to the GuiTools is executed.

This is the last commit, many thanks to @matthijskooijman for having menthored me :)

I think it's helpful to have @matthijskooijman explanation on this use of the wrapper:

This defines a new wrapper function, that calls the original callback and then calls resetTrackers. Note that this creates a new function for every loop iteration, so each of these wrapper functions captures potentially different callback, self and obj values so things work as expected. Note I did something weird with the callback value there: Since functions like these capture a variable, not its value at the time of function definition, and loop variables like label and callback are a single variable shared between all loop iterations, capturing callback directly ends up with all wrappers calling the last callback (i.e. they all capture the same variable and by the time the wrappers are called, that variable will contain the last of the callbacks). This is commonly solved by using a default value in the function definition, since such a default value uses the value of the (in this case) callback variable, not capturing the variable.
2021-06-01 23:20:41 +02:00
carlopav
4db4d1c34f Draft: Edit, Added reverse wire option to context menu
Now Draft Edit can reverse the order of the points of a Draft_Wire
2021-06-01 22:53:24 +02:00
carlopav
d3b524704f Draft: Edit, rewriting context menu system
get_edit_point_context_menu(self, edit_command, obj, node_idx)
get_edit_obj_context_menu(self, edit_command, obj, position)
that are called depending if the user is over an editpoint or over another part of the object.
2021-06-01 22:53:01 +02:00
carlopav
50a596f687 Draft: Edit, Split out addPoint in multiple methods in the GuiTools
Now Draft_Wire, Draft_BSpline, Draft_Bezcurve have their own methods to add points.
2021-06-01 21:57:38 +02:00
carlopav
2e36f8a832 Draft: Edit, change startEditing method to accept (obj, node_idx)
This enable to start editing also without an user click event, by just calling the method and specifying the object and the edit point index.
It is used for alternative edit mode (alt_edit_mode) by arc context menu
2021-06-01 21:47:37 +02:00
carlopav
aa7dddeecc Draft: Edit, Remove all the empty pass functions
Remove unused functions. Since GuiTools objects inherit from the GuiTools class, they do not need those placeholders.
2021-06-01 21:47:37 +02:00
marioalexis
86d5cd0cfe Draft: Add shortcut to fillet command 2021-05-31 16:18:36 -03:00
Matthijs Kooijman
d928f37761 Draft: Fix "Show groups in layer list drop-down button" preference
The code that was intended to handle this preference looked inside
Mod/BIM instad of Mod/Draft for the preference. This seems to have been
broken since the preference was first introduced in commit 9976a5ece0
(Draft: Turned autogroup button into layers selector (added pref option
to restore old groups-based system)).

This also removes a stray "-" that was probably a leftover from a merge
conflict, introduced in commit 0547d23660 (Draft: move Draft_AutoGroup to
gui_groups module). Since -True is still true and -False is still false,
this did not actually break the code, though.

See https://forum.freecadweb.org/viewtopic.php?t=42018 for related
discussion.
2021-05-22 18:33:15 +02:00
Yorik van Havre
dbd7dbd332 Draft: Fixed use of double quotes in Draft Texts 2021-05-21 15:35:29 +02:00
Yorik van Havre
fd9c075411 Draft: Added 'apply to texts/dims' button to SetStyle dialog 2021-05-11 16:24:06 +02:00
Yorik van Havre
489f7441af Draft: Allow to use dimension tool with predefined direction 2021-05-11 13:27:41 +02:00
Yorik van Havre
dd3f723465 Draft: Added load/save functionality to SetStyle dialog 2021-05-06 18:36:41 +02:00
Yorik van Havre
966906da96 Merge pull request #4557 from luzpaz/crowdin/whitespaces-substituted-into-code
Crowdin: represent whitespace in code instead of in string
2021-05-05 17:18:35 +02:00
Roy-043
e13bf0fac7 Update gui_points.py
Gui.addModule("Draft") should be executed before committing _cmd_list irrespective of the UsePartPrimitives setting.
2021-04-29 21:07:07 +02:00
Roy-043
a3778eacd4 Update gui_arcs.py
Gui.addModule("Draft") should be executed before committing _cmd_list irrespective of the UsePartPrimitives setting.
2021-04-29 21:05:52 +02:00