Re: [Kicad-developers] [PATCH] bugfix: OPENGL_GAL::drawPolygon did not respect fill settings
Great, I pushed your patch to the master branch. Thank you for your contribution. The line: +if(isFillEnabled){ should look like: +if( isFillEnabled ) +{ As I said, nothing I could not fix myself. I realize switching between projects with different code formatting is not easy, but perhaps you may find useful either uncrustify or clang-format - we provide configuration files for both (uncrustify.cfg and _clang-format in the root directory). Cheers, Orson On 12/11/2017 10:20 AM, Andreas Buhr wrote: > On 12/11/2017 10:11 AM, Maciej Sumiński wrote: >> >> There is a minor code formatting violation, that I will fix. I suppose >> that unfilled polygons have not been used so far, therefore the issue >> could not be observed. If you use them, can you confirm the behavior is >> coherent with the cairo backend? > > Hello Orson, > > thanks a lot. > What was the formatting violation? I'll try to format my coming patches > better. > > The behavior is coherent with the cairo backend, i.e. the cairo backend > fills correctly. > > Cheers, > aDnreas > > ___ > Mailing list: https://launchpad.net/~kicad-developers > Post to : kicad-developers@lists.launchpad.net > Unsubscribe : https://launchpad.net/~kicad-developers > More help : https://help.launchpad.net/ListHelp > signature.asc Description: OpenPGP digital signature ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] [PATCH] bugfix: OPENGL_GAL::drawPolygon did not respect fill settings
On 12/11/2017 10:11 AM, Maciej Sumiński wrote: > > There is a minor code formatting violation, that I will fix. I suppose > that unfilled polygons have not been used so far, therefore the issue > could not be observed. If you use them, can you confirm the behavior is > coherent with the cairo backend? Hello Orson, thanks a lot. What was the formatting violation? I'll try to format my coming patches better. The behavior is coherent with the cairo backend, i.e. the cairo backend fills correctly. Cheers, aDnreas ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] [PATCH] bugfix: OPENGL_GAL::drawPolygon did not respect fill settings
Andreas, There is a minor code formatting violation, that I will fix. I suppose that unfilled polygons have not been used so far, therefore the issue could not be observed. If you use them, can you confirm the behavior is coherent with the cairo backend? Cheers, Orson On 12/08/2017 12:53 PM, Andreas Buhr wrote: > Dear Kicad developers, > > The OPENGL_GAL::drawPolygon function and all functions using it > did not respect the isFillEnabled member set by > GAL::SetIsFill. This is fixed by the attached patch. > > I hope you find it useful. > Cheers, > Andreas > > > > ___ > Mailing list: https://launchpad.net/~kicad-developers > Post to : kicad-developers@lists.launchpad.net > Unsubscribe : https://launchpad.net/~kicad-developers > More help : https://help.launchpad.net/ListHelp > signature.asc Description: OpenPGP digital signature ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
[Kicad-developers] [PATCH] bugfix: OPENGL_GAL::drawPolygon did not respect fill settings
Dear Kicad developers, The OPENGL_GAL::drawPolygon function and all functions using it did not respect the isFillEnabled member set by GAL::SetIsFill. This is fixed by the attached patch. I hope you find it useful. Cheers, Andreas >From d99a51c99e03bc6c28f2c0bc12c4a2327ecc378e Mon Sep 17 00:00:00 2001 From: Andreas BuhrDate: Fri, 8 Dec 2017 12:44:46 +0100 Subject: [PATCH] bugfix: OPENGL_GAL::drawPolygon did not respect fill settings The OPENGL_GAL::drawPolygon function and all functions using it did not respect the isFillEnabled member set by GAL::SetIsFill. This is fixed by this patch. --- common/gal/opengl/opengl_gal.cpp | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 63f08ee..763d08f 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -1511,28 +1511,30 @@ void OPENGL_GAL::drawStrokedSemiCircle( const VECTOR2D& aCenterPoint, double aRa void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount ) { -currentManager->Shader( SHADER_NONE ); -currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a ); +if(isFillEnabled){ +currentManager->Shader( SHADER_NONE ); +currentManager->Color( fillColor.r, fillColor.g, fillColor.b, fillColor.a ); -// Any non convex polygon needs to be tesselated -// for this purpose the GLU standard functions are used -TessParams params = { currentManager, tessIntersects }; -gluTessBeginPolygon( tesselator, ); -gluTessBeginContour( tesselator ); +// Any non convex polygon needs to be tesselated +// for this purpose the GLU standard functions are used +TessParams params = { currentManager, tessIntersects }; +gluTessBeginPolygon( tesselator, ); +gluTessBeginContour( tesselator ); -GLdouble* point = aPoints; +GLdouble* point = aPoints; -for( int i = 0; i < aPointCount; ++i ) -{ -gluTessVertex( tesselator, point, point ); -point += 3; // 3 coordinates -} +for( int i = 0; i < aPointCount; ++i ) +{ +gluTessVertex( tesselator, point, point ); +point += 3; // 3 coordinates +} -gluTessEndContour( tesselator ); -gluTessEndPolygon( tesselator ); +gluTessEndContour( tesselator ); +gluTessEndPolygon( tesselator ); -// Free allocated intersecting points -tessIntersects.clear(); +// Free allocated intersecting points +tessIntersects.clear(); +} if( isStrokeEnabled ) drawPolyline( [&](int idx) { return VECTOR2D( aPoints[idx * 3], aPoints[idx * 3 + 1] ); }, -- 2.7.4 ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp