← Back to team overview

kicad-developers team mailing list archive

Patch to fix a Offset range bug on 3D Settings (Footprint)

 

Hi all,

Attached is a patch that fixes a bug on the Offset of 3D Settings (Footprint)
The value range of the offset parameters were not set so it was not able to enter values <-10

It also made some small layout changes on the orientation parameters in order to make it vertical smaller.

Hope you can add it to the main branch.

Regards,
Mario Luzeiro
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: mrluzeiro@xxxxx-20160608212540-gldthxlyh5bb8daq
# target_branch: lp:kicad
# testament_sha1: e55fc94217057f0125ceb37191169eb2cee28887
# timestamp: 2016-06-08 22:26:31 +0100
# base_revision_id: pavlina.chris@xxxxxxxxx-20160608111953-\
#   o6xhypl2d2806hip
# 
# Begin patch
=== modified file '3d-viewer/3d_cache/dialogs/panel_prev_model.cpp'
--- 3d-viewer/3d_cache/dialogs/panel_prev_model.cpp	2016-05-02 13:56:12 +0000
+++ 3d-viewer/3d_cache/dialogs/panel_prev_model.cpp	2016-06-08 21:25:40 +0000
@@ -131,10 +131,11 @@
             aParent->FindWindowByLabel( wxT( "3D_MODEL_SELECTOR" ), aParent );
 
     wxFloatingPointValidator< float > valScale( 4 );
-    valScale.SetRange( 0.0001, 9999 );
+    valScale.SetRange( 0.0001, 9999.0 );
     wxFloatingPointValidator< float > valRotate( 2 );
     valRotate.SetRange( -180.0, 180.0 );
-    wxFloatingPointValidator< float > valOffset( 6 );
+    wxFloatingPointValidator< float > valOffset( 4 );
+    valOffset.SetRange( -9999.0, 9999.0 );
 
     wxStaticBoxSizer* vbScale = new wxStaticBoxSizer( wxVERTICAL, this, _( "Scale" )  );
     wxStaticBoxSizer* vbRotate = new wxStaticBoxSizer( wxVERTICAL, this, _( "Rotation" ) );
@@ -165,16 +166,16 @@
     hbS2->Add( yscale, 0, wxALL, 2 );
     hbS3->Add( txtS3, 0, wxALL, 2 );
     hbS3->Add( zscale, 0, wxALL, 2 );
-    vbScale->Add( hbS1, 0, wxEXPAND | wxALL, 2 );
-    vbScale->Add( hbS2, 0, wxEXPAND | wxALL, 2 );
-    vbScale->Add( hbS3, 0, wxEXPAND | wxALL, 2 );
+    vbScale->Add( hbS1, 0, wxEXPAND | wxALL, 0 );
+    vbScale->Add( hbS2, 0, wxEXPAND | wxALL, 0 );
+    vbScale->Add( hbS3, 0, wxEXPAND | wxALL, 0 );
 
     wxBoxSizer* hbR1 = new wxBoxSizer( wxHORIZONTAL );
     wxBoxSizer* hbR2 = new wxBoxSizer( wxHORIZONTAL );
     wxBoxSizer* hbR3 = new wxBoxSizer( wxHORIZONTAL );
-    wxStaticText* txtR1 = new wxStaticText( modRotate, ID_ROTX, wxT( "X:" ) );
-    wxStaticText* txtR2 = new wxStaticText( modRotate, ID_ROTY, wxT( "Y:" ) );
-    wxStaticText* txtR3 = new wxStaticText( modRotate, ID_ROTZ, wxT( "Z:" ) );
+    wxStaticText* txtR1 = new wxStaticText( modRotate, -1, wxT( "X:" ) );
+    wxStaticText* txtR2 = new wxStaticText( modRotate, -1, wxT( "Y:" ) );
+    wxStaticText* txtR3 = new wxStaticText( modRotate, -1, wxT( "Z:" ) );
     xrot = new wxTextCtrl( modRotate, ID_ROTX, "0.0", wxDefaultPosition, wxDefaultSize,
         wxTE_PROCESS_ENTER, valRotate );
     yrot = new wxTextCtrl( modRotate, ID_ROTY, "0.0", wxDefaultPosition, wxDefaultSize,
@@ -190,9 +191,9 @@
     hbR2->Add( yrot, 0, wxALL, 2 );
     hbR3->Add( txtR3, 0, wxALL, 2 );
     hbR3->Add( zrot, 0, wxALL, 2 );
-    vbRotate->Add( hbR1, 0, wxEXPAND | wxALL, 2 );
-    vbRotate->Add( hbR2, 0, wxEXPAND | wxALL, 2 );
-    vbRotate->Add( hbR3, 0, wxEXPAND | wxALL, 2 );
+    vbRotate->Add( hbR1, 0, wxEXPAND | wxALL, 0 );
+    vbRotate->Add( hbR2, 0, wxEXPAND | wxALL, 0 );
+    vbRotate->Add( hbR3, 0, wxEXPAND | wxALL, 0 );
 
     wxBoxSizer* hbO1 = new wxBoxSizer( wxHORIZONTAL );
     wxBoxSizer* hbO2 = new wxBoxSizer( wxHORIZONTAL );
@@ -206,18 +207,18 @@
         wxTE_PROCESS_ENTER, valOffset );
     zoff = new wxTextCtrl( modOffset, ID_OFFZ, "0.0", wxDefaultPosition, wxDefaultSize,
         wxTE_PROCESS_ENTER, valOffset );
-    xoff->SetMaxLength( 9 );
-    yoff->SetMaxLength( 9 );
-    zoff->SetMaxLength( 9 );
+    xoff->SetMaxLength( 10 );
+    yoff->SetMaxLength( 10 );
+    zoff->SetMaxLength( 10 );
     hbO1->Add( txtO1, 0, wxALL, 2 );
     hbO1->Add( xoff, 0, wxALL, 2 );
     hbO2->Add( txtO2, 0, wxALL, 2 );
     hbO2->Add( yoff, 0, wxALL, 2 );
     hbO3->Add( txtO3, 0, wxALL, 2 );
     hbO3->Add( zoff, 0, wxALL, 2 );
-    vbOffset->Add( hbO1, 0, wxEXPAND | wxALL, 2 );
-    vbOffset->Add( hbO2, 0, wxEXPAND | wxALL, 2 );
-    vbOffset->Add( hbO3, 0, wxEXPAND | wxALL, 2 );
+    vbOffset->Add( hbO1, 0, wxEXPAND | wxALL, 0 );
+    vbOffset->Add( hbO2, 0, wxEXPAND | wxALL, 0 );
+    vbOffset->Add( hbO3, 0, wxEXPAND | wxALL, 0 );
 
     // hbox holding orientation data and preview
     wxBoxSizer* hbox = new wxBoxSizer( wxHORIZONTAL );
@@ -226,14 +227,13 @@
     // vbox holding the preview and view buttons
     wxBoxSizer* vboxPrev = new wxBoxSizer( wxVERTICAL );
 
-    vboxOrient->Add( vbScale, 0, wxALL, 5 );
-    vboxOrient->Add( vbRotate, 0, wxALL, 5 );
-    vboxOrient->Add( vbOffset, 0, wxALL, 5 );
-    vboxOrient->AddSpacer( 20 );
+    vboxOrient->Add( vbScale, 0, wxEXPAND | wxALL, 1 );
+    vboxOrient->Add( vbRotate, 0, wxEXPAND | wxALL, 1 );
+    vboxOrient->Add( vbOffset, 0, wxEXPAND | wxALL, 1 );
 
     // add preview items
     preview = new wxPanel( this, -1 );
-    preview->SetMinSize( wxSize( 320, 200 ) );
+    preview->SetMinSize( wxSize( 400, 250 ) );
     preview->SetBackgroundColour( wxColor( 0, 0, 0 ));
     vboxPrev->Add( preview, 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );
     // buttons:
@@ -267,8 +267,8 @@
     vboxPrev->Hide( hbBT, true );
     vboxPrev->Hide( hbBB, true );
 
-    hbox->Add( vboxOrient, 0, wxALL, 5 );
-    hbox->Add( vboxPrev, 1, wxEXPAND );
+    hbox->Add( vboxOrient, 0, wxEXPAND | wxALL, 0 );
+    hbox->Add( vboxPrev, 1, wxEXPAND | wxALL, 12 );
     vbox->Add( hbox, 1, wxEXPAND );
 
     mainBox->Add( vbox, 1, wxEXPAND | wxALL, 5 );

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWeZ1TH4AAvFfgEAQUHf//3cH
3XC////0UAWeOQAUAdABoDmmJkyaMJgmJpgEwCGCMCMA1TEg2p6nohoBkyaA0AAMhhDTCAmjJTap
4p6Q000B6hoAA0A00AHNMTJk0YTBMTTAJgEMEYEYBJEJoJkxNAI00FPak8jFNqntUeJ6SepvKamS
gAsdusQ33h6mGzKeTNpcZhmBoM4zECN9LXIChQd5w11T10Sab3AIHAWK/7mbRWwytZRe2FjCiRHN
Kpm4j5xZmSHQo+v1CyKoqehNdEsbmtMTLTmCo5DWTPBCJ5AMTip5qJUETcNU0w1w0aJ5/Lekq3+e
f8sEAfAEkGOPKKywXS9laiv62GCc4FRAPKPBUJ+hLaJP7p1UJalw5/74w+G3an5J0fZaD8re80Dq
h0QfrZCUVBfQR1KHZ2MzM8iS92uoYSYKVZxwH9lWJyhUQVYmX+HUttguEqr12YeSmqLKetdYsXS9
75WT3Y3d/mUkWAYZL5MGDB844URQugTDDwicXeaFrrsJFAjnFwmoIM9irT1WxqlLSo3IItnVf49W
/quj0VCqgvjidtpj86ck16aMqoZZJxXUP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