From e84faeb3d6eff48c6fb4f4d7441cc7c04e83a5fe Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 8 Dec 2017 17:41:42 -0800 Subject: [PATCH] Make sure we update the view as we subtract Respect OEM store setting Fixed link on + tab --- PartPreviewWindow/PlusTab/ExploreItem.cs | 4 +-- PartPreviewWindow/PlusTab/ExplorePanel.cs | 2 +- PartPreviewWindow/PlusTab/PlusTabPage.cs | 34 +++---------------- .../View3D/Actions/PaintMaterialEditor.cs | 2 ++ .../View3D/Actions/SubtractEditor.cs | 1 + Submodules/agg-sharp | 2 +- 6 files changed, 11 insertions(+), 34 deletions(-) diff --git a/PartPreviewWindow/PlusTab/ExploreItem.cs b/PartPreviewWindow/PlusTab/ExploreItem.cs index df0e2b43a..1bceee417 100644 --- a/PartPreviewWindow/PlusTab/ExploreItem.cs +++ b/PartPreviewWindow/PlusTab/ExploreItem.cs @@ -83,9 +83,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab { MatterControlApplication.Instance.LaunchBrowser("http://www.matterhackers.com/" + item.url); } - else if (item.reference != null) + else if (item.link != null) { - MatterControlApplication.Instance.LaunchBrowser(item.reference); + MatterControlApplication.Instance.LaunchBrowser(item.link); } base.OnClick(mouseEvent); diff --git a/PartPreviewWindow/PlusTab/ExplorePanel.cs b/PartPreviewWindow/PlusTab/ExplorePanel.cs index ecff83b25..5666a7182 100644 --- a/PartPreviewWindow/PlusTab/ExplorePanel.cs +++ b/PartPreviewWindow/PlusTab/ExplorePanel.cs @@ -169,7 +169,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab public string description; public string hero; public string icon; - public string reference; + public string link; public string title; public string url; } diff --git a/PartPreviewWindow/PlusTab/PlusTabPage.cs b/PartPreviewWindow/PlusTab/PlusTabPage.cs index 0d7dbcd72..09c434203 100644 --- a/PartPreviewWindow/PlusTab/PlusTabPage.cs +++ b/PartPreviewWindow/PlusTab/PlusTabPage.cs @@ -49,7 +49,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab }; this.AddChild(leftContent); - this.AddChild(new ExplorePanel(theme)); + if (OemSettings.Instance.ShowShopButton) + { + this.AddChild(new ExplorePanel(theme)); + } this.HAnchor = HAnchor.Stretch; this.VAnchor = VAnchor.Stretch; @@ -169,35 +172,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab }); }; otherItemsSection.AddChild(redeemShareCode); - - if (OemSettings.Instance.ShowShopButton) - { - var shopButton = theme.ButtonFactory.Generate("Buy Materials".Localize(), AggContext.StaticData.LoadIcon("icon_shopping_cart_32x32.png", 24, 24, IconColor.Theme)); - shopButton.ToolTipText = "Shop online for printing materials".Localize(); - shopButton.Name = "Buy Materials Button"; - shopButton.HAnchor = HAnchor.Left; - shopButton.Margin = buttonSpacing; - shopButton.Click += (sender, e) => - { - UiThread.RunOnIdle(() => - { - simpleTabs.RemoveTab(simpleTabs.ActiveTab); - - double activeFilamentDiameter = 0; - if (ActiveSliceSettings.Instance.PrinterSelected) - { - activeFilamentDiameter = 3; - if (ActiveSliceSettings.Instance.GetValue(SettingsKey.filament_diameter) < 2) - { - activeFilamentDiameter = 1.75; - } - } - - MatterControlApplication.Instance.LaunchBrowser("http://www.matterhackers.com/mc/store/redirect?d={0}&clk=mcs&a={1}".FormatWith(activeFilamentDiameter, OemSettings.Instance.AffiliateCode)); - }); - }; - otherItemsSection.AddChild(shopButton); - } } private FlowLayoutWidget CreateSection(GuiWidget parent, string headingText) diff --git a/PartPreviewWindow/View3D/Actions/PaintMaterialEditor.cs b/PartPreviewWindow/View3D/Actions/PaintMaterialEditor.cs index 31035d313..57e54e110 100644 --- a/PartPreviewWindow/View3D/Actions/PaintMaterialEditor.cs +++ b/PartPreviewWindow/View3D/Actions/PaintMaterialEditor.cs @@ -209,6 +209,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D { paint.Mesh = PolygonMesh.Csg.CsgOperations.Union(paint.Mesh, intersectAndSubtract.intersect); } + + view3DWidget.Invalidate(); } // move the paint mesh back to its original coordinates diff --git a/PartPreviewWindow/View3D/Actions/SubtractEditor.cs b/PartPreviewWindow/View3D/Actions/SubtractEditor.cs index c6f79b335..1ef1a2135 100644 --- a/PartPreviewWindow/View3D/Actions/SubtractEditor.cs +++ b/PartPreviewWindow/View3D/Actions/SubtractEditor.cs @@ -174,6 +174,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D inverse.Invert(); transformedKeep.Transform(inverse); keep.Mesh = transformedKeep; + view3DWidget.Invalidate(); } remove.Visible = false; diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index fe3ea44b1..883160d3d 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit fe3ea44b1e3d07e62a1eb57ce6c3351e7c3308f2 +Subproject commit 883160d3d769e23ba0f99466526adc2a0342eeb0