Commit Graph

142 Commits

Author SHA1 Message Date
jean-pierre charras bbfc5c272e Fix my commit d07738a06c.
( a DC->SetPen() was deleted by mistake)
2023-02-25 19:06:46 +01:00
jean-pierre charras d07738a06c gr_basic.cpp: ensure a pen with width = 0 is transparent.
Setting its color to COLOR4D::UNSPECIFIED (i.e. opacity = 0) is not enough
for all  platforms (i.e. Windows)
2023-02-21 20:06:54 +01:00
Marek Roszko aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
Jeff Young 03484aedbc Workaround wxWidgets enforced min pen width by using transparent pen.
Also fixes some bugs in our shape printing code when a border is not
specified but a fill is.

Fixes https://gitlab.com/kicad/code/kicad/issues/13891
2023-02-14 14:44:04 +00:00
Jeff Young 60bcfd1bf1 Bug fixes in arc & textbox printing.
Also removal of the no-longer-used clipping code from GR*.
2022-01-31 20:00:47 +00:00
Jeff Young e37ca2f757 Remove dead code. 2022-01-18 01:40:03 +00:00
Seth Hillbrand de006fc010 Fix transparent circle printing
DrawEllipse seems to work fine using transparent bg for all DCs except
printing (which is the only one we use now)  Use two arcs to draw a
transparent fill for the circle instead as a workaround until we
implement Cairo printing

Fixes https://gitlab.com/kicad/code/kicad/issues/10431

(cherry picked from commit cccdac136f)
2022-01-14 16:13:35 -08:00
Jeff Young 07013d00e1 More EDA_ANGLE. 2022-01-14 16:08:19 +00:00
Jeff Young 7d032f9c2f Outline font rendering for Cairo, plotter, printer and 3D viewer.
Fixes https://gitlab.com/kicad/code/kicad/issues/10319
2022-01-10 01:54:28 +00:00
Marek Roszko 726d873c53 Tear down the wxPoint trigo helpers 2022-01-04 21:23:11 -05:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00
Jeff Young 1bb750814d Cleanup dead code. 2021-11-17 12:49:53 +00:00
Jeff Young 7760d3275d Fix printing of LIB_SHAPE arcs. 2021-11-17 01:39:16 +00:00
Wayne Stambaugh 8fd83cbb95 Pass wxPoint objects by reference instead of on the stack. 2021-07-26 15:35:33 -04:00
Wayne Stambaugh 89b1fdabe9 Pass COLOR4D object by reference instead of on the stack. 2021-07-26 13:28:56 -04:00
Wayne Stambaugh bcd6bddfd4 Start expunging NULL.
Given that KiCad is a C++ project, we should really be using nullptr
instead of NULL.
2021-07-15 15:44:45 -04:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Marek Roszko b2e9f6987d Split base_struct into eda_item and eda_rect 2020-10-13 21:24:50 -04:00
jean-pierre charras 87a220b8e2 more cleanup about removing useless include 2020-10-02 14:51:11 +02:00
Simon Richter c407e96b14 std::min/std::max requires <algorithm> 2020-07-11 15:46:57 +02:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Seth Hillbrand eb3d32f967 SHAPE_LINE_CHAIN: Unify constructors
Keeps the multi element SHAPE_LINE_CHAIN constructors in a single
routine using std::vector and implicit construction.
2019-12-12 13:54:48 +00:00
Seth Hillbrand c4d853c1e8 SHAPE_LINE_CHAIN: Remove element access
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines.  To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
2019-12-12 13:54:48 +00:00
Seth Hillbrand b5f021ff9f Cleanup: Replace push_back with emplace_back
In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
2019-12-05 13:41:21 -08:00
jean-pierre charras 943858fd67 FIX: Bezier curves: replace previous algorithm to convert the curve to segments. In some cases it was not working well. Opengl was using an other algo (using the curve properties to create segments) Now only the OpenGL algo is used, with optimization to reduce the number of segments. 2019-11-09 11:41:29 +01:00
Seth Hillbrand e52afd93a3 Remove Legacy options for overlay/context
These options were used to support the legacy canvas when drawing on
MacOS and GTK3.  With the move to 100% GAL, they are extraneous.  This
moves all DC over to "COPY" as we only use this for printing support in
Eeschema at the moment, so there is a single draw command (no erasing)
for the canvas.
2019-06-12 06:01:03 -07:00
Jeff Young c3cc85eb1c A little bit of cleanup. 2019-06-10 23:46:00 +01:00
Jeff Young e9e28b9aac Retire legacy block architecture. 2019-05-27 11:58:56 +01:00
Jeff Young fee52e127f Add line style drawing. 2018-10-09 11:08:56 +01:00
Maciej Suminski f0adf81a99 Do not draw circles of 0 radius
Apparently calling wxDC::DrawEllipse() with parameters resulting in a
circle with radius equal to 0 lead to printing problems.

Fixes: lp:1746210
* https://bugs.launchpad.net/kicad/+bug/1746210
2018-02-06 17:28:56 +01:00
jean-pierre charras d0754acf00 Fix code after renaming files 2018-01-29 11:37:29 +01:00
Chris Pavlina 6cee19d37d eeschema: neatly wrap placeholder text in symbol chooser 2018-01-07 19:30:56 -07:00
Seth Hillbrand b576189a00 Eeschema: Adding line styling options
NEW: Adds support in eeschema for changing the default line style,
width and color on a case-by-case basis.

CHANGED: "Wire" lines now optionally include data on the line style,
width and color if they differ from the default.

Fixes: lp:594059
* https://bugs.launchpad.net/kicad/+bug/594059

Fixes: lp:1405026
* https://bugs.launchpad.net/kicad/+bug/1405026
2017-11-15 08:10:51 +01:00
jean-pierre charras d2d1237506 minor enhancement in code 2017-10-26 10:55:01 +02:00
Simon Richter 48ed0dcda2 code enhancement (remove duplicate) 2017-10-26 10:19:15 +02:00
Maciej Suminski e79f97860c Bezier2Poly refactor
Before the refactor library browser display Bezier curves correctly only
once, at other times they were just straight lines or crashed the
application.
2017-05-16 17:58:09 +02:00
Maciej Suminski 0dc88bb4cf Changed COLOR4D defines to static consts 2017-02-22 17:35:00 +01:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
Maciej Suminski 25d526cbc6 Fixed a crash when GRLineArray is called with an empty vector. 2016-05-26 17:14:08 +02:00
Bernhard Stegmaier 8c78bd5fd8 OSX: legacy canvas rendering speed improvements.
* Enables USE_WX_GRAPHICS_CONTEXT for OSX by default.  This shouldn¡¯t be a
  major change because it seems to get used on OSX behind the scenes anyway.
  As a side effect, this might improve behavior with anti-aliasing because
  KiCad shifts drawing by (0.5, 0.5) into the middle of the virtual pixels so
  things may be less blurry.  It will still build without enabling
  USE_WX_GRAPHICS_CONTEXT, but the optimizations obviously won¡¯t be used.
* The optimizations currently only are effective when USE_WX_GRAPHICS_CONTEXT
  is enabled and OSX.  They might be also good for other platforms using
  USE_WX_GRAPHICS_CONTEXT because it aggregates some drawing primitives using
  paths wxGraphicsContext provides.
* It adds some #ifdefs for disabling the wxGraphicsContext stuff when
  USE_WX_GRAPHICS_CONTEXT isn¡¯t enabled.  If you hate #ifdefs, this also
  could be dropped but then it will always check if wxGraphicsContext can be
  applied.
2016-01-04 15:13:10 -05:00
jean-pierre charras d5aef07816 Kicad manager: fix a very serious bug which crashes Kicad when running and closing gerbview, pcb_calculator, bitmap2component or pl_editor, when the Kicad manager frame is not the top level frame (It happens very easily if eeschema or pcbnew is running, after opening and closing a dialog).
Fix a few wxWidgets asserts.
menubar in pcbnew: move the recreate .cmp file menu to export menu, and fixes its help comment which was fully outdated.
2015-11-15 19:04:19 +01:00
jean-pierre charras 91391a5975 Small change in gr_basic.cpp to try to fix Bug #1514635, which is a bug in wxWidgets Print process, on Linux (current pen having sometimes its setup lost after setting wxBrush in curren DC)
It was previoulsy incorrectly fixed when forcing the black and white print option.
2015-11-10 13:17:33 +01:00
jean-pierre charras ade51289a7 All: use solid lines instead of dashed lines to draw X and Y axis in legacy canvas (like in Gal canvas). The main reason: on OSX axis using dashed lines are very very slow to draw (looks like a wxWidget issue when the wxDC scale factor is very small) 2015-10-25 17:58:04 +01:00
jean-pierre charras 6dd0073130 Move the non shared file class_sch_screen.h to eeschema folder. Code cleaning. Remove some wxCHECK_VERSION tests now useless. 2015-07-29 20:06:45 +02:00
Maciej Suminski b74b2efff0 More printing fixes. 2015-03-25 18:27:17 +01:00
Maciej Suminski 0b7fd874a0 Fixed printing issues under Linux. 2015-03-25 10:55:00 +01:00
jean-pierre charras 086ff54ef0 Fix minor issues: plot svg did not handle dashed lines.
Eeschema now uses dashed lines for graphic lines (to be consistent with plot functions and toolbal icon).
Fix an old bug in some envionments which warp the mouse on a bad monitor when opening eeschema, pcbnew and some other windows, only noticeable guys who are lucky enough to have more than one monitor.
2015-03-06 18:46:04 +01:00
jean-pierre charras 9a7116d4ab Update old demo board files. Minor code cleaning. 2014-07-04 21:36:43 +02:00
Lorenzo Marcantonio 07877f9044 Replaced the display line clipper with the way simpler (and faster) Cohen-Sutherland one.
A couple of trivial accessors made inline
2014-05-21 19:02:32 +02:00
jean-pierre charras d54ade9403 Rework on DXF export. 2014-05-17 21:29:15 +02:00