Re: [Kicad-developers] [PATCH] Bugfix: EDA_RECT to BOX2I generated wrong boxes

2017-12-11 Thread Maciej SumiƄski
Hi Andreas,

Good catch, it must have been like this since the GAL origin. I have
applied your patch to the master branch. Thank you!

Cheers,
Orson


On 12/10/2017 11:08 PM, Andreas Buhr wrote:
> Dear Kicad developers,
> 
> The "operator BOX2I() const" of EDA_RECT produced wrong boxes, usually
> much to big. It passed its end-position as second argument to the
> constructor of BOX2I. However, BOX2I expects its size as second
> argument.
> 
> This caused a dramatic performance penalty in some
> cases. Took me about a day to figure this out.
> 
> 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: EDA_RECT to BOX2I generated wrong boxes

2017-12-10 Thread Andreas Buhr
Dear Kicad developers,

The "operator BOX2I() const" of EDA_RECT produced wrong boxes, usually
much to big. It passed its end-position as second argument to the
constructor of BOX2I. However, BOX2I expects its size as second
argument.

This caused a dramatic performance penalty in some
cases. Took me about a day to figure this out.

Cheers,
Andreas
>From 90f991e9938e0841908e58d665103e0f41fdbb43 Mon Sep 17 00:00:00 2001
From: Andreas Buhr 
Date: Sun, 10 Dec 2017 23:04:23 +0100
Subject: [PATCH] Bugfix: EDA_RECT to BOX2I generated wrong boxes

The "operator BOX2I() const" of EDA_RECT produced
wrong boxes, usually much to big. It passed its
end-position as second argument to the constructor
of BOX2I. However, BOX2I expects its size as second
argument.

This caused a dramatic performance penalty in some
cases.
---
 include/class_eda_rect.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/class_eda_rect.h b/include/class_eda_rect.h
index 3062d0a..c6b0acf 100644
--- a/include/class_eda_rect.h
+++ b/include/class_eda_rect.h
@@ -227,7 +227,7 @@ public:
 {
 EDA_RECT rect( m_Pos, m_Size );
 rect.Normalize();
-return BOX2I( rect.GetOrigin(), rect.GetEnd() );
+return BOX2I( rect.GetOrigin(), rect.GetSize() );
 }
 
 /**
-- 
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