Made width depth scale controls work with variables
This commit is contained in:
parent
8d386825d0
commit
abe5d17012
17 changed files with 300 additions and 123 deletions
|
|
@ -56,7 +56,8 @@ namespace MatterHackers.Plugins.EditorTools
|
|||
private readonly double selectCubeSize = 7 * GuiWidget.DeviceScale;
|
||||
|
||||
private readonly ThemeConfig theme;
|
||||
|
||||
private readonly Func<double> getWidth;
|
||||
private readonly Func<double> getDepth;
|
||||
private readonly InlineEditControl xValueDisplayInfo;
|
||||
|
||||
private readonly InlineEditControl yValueDisplayInfo;
|
||||
|
|
@ -70,6 +71,10 @@ namespace MatterHackers.Plugins.EditorTools
|
|||
private ScaleController scaleController;
|
||||
|
||||
public ScaleWidthDepthEdgeControl(IObject3DControlContext context,
|
||||
Func<double> getWidth,
|
||||
Action<double> setWidth,
|
||||
Func<double> getDepth,
|
||||
Action<double> setDepth,
|
||||
Func<double> getHeight,
|
||||
Action<double> setHeight,
|
||||
int edgeIndex)
|
||||
|
|
@ -77,7 +82,9 @@ namespace MatterHackers.Plugins.EditorTools
|
|||
{
|
||||
theme = MatterControl.AppContext.Theme;
|
||||
|
||||
scaleController = new ScaleController(getHeight, setHeight);
|
||||
this.getWidth = getWidth;
|
||||
this.getDepth = getDepth;
|
||||
scaleController = new ScaleController(getWidth, setWidth, getDepth, setDepth, getHeight, setHeight);
|
||||
|
||||
xValueDisplayInfo = new InlineEditControl()
|
||||
{
|
||||
|
|
@ -320,9 +327,8 @@ namespace MatterHackers.Plugins.EditorTools
|
|||
{
|
||||
if (hadClickOnControl)
|
||||
{
|
||||
if (RootSelection is IObjectWithWidthAndDepth widthDepthItem
|
||||
&& (widthDepthItem.Width != scaleController.InitialState.Width
|
||||
|| widthDepthItem.Depth != scaleController.InitialState.Depth))
|
||||
if (getWidth() != scaleController.InitialState.Width
|
||||
|| getDepth() != scaleController.InitialState.Depth)
|
||||
{
|
||||
scaleController.EditComplete();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue