diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-19 17:17:25 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-19 17:17:25 +0200 |
| commit | 8feeef663f8984c609cb3aa530d09ffcffda5709 (patch) | |
| tree | 6b69a7a62ea1234ba5b16948dd3781078834a973 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters | |
| parent | 95b4e14bc4e06ffb94199f5ec4e0d2d9bebceeff (diff) | |
| download | Tango-8feeef663f8984c609cb3aa530d09ffcffda5709.tar.gz Tango-8feeef663f8984c609cb3aa530d09ffcffda5709.zip | |
Working on new developer module...
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters')
6 files changed, 8 insertions, 8 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetLimitConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetLimitConverter.cs index 62d678888..96c44a5a0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetLimitConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetLimitConverter.cs @@ -22,11 +22,11 @@ namespace Tango.MachineStudio.Developer.Converters if (stop != null && segment != null) { - if (segment.BrushStops.IndexOf(stop) == segment.BrushStops.Count - 1) + if (stop.IsLast) { return 100d; } - else if (segment.BrushStops.IndexOf(stop) == 0) + else if (stop.IsFirst) { return 0d; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetValueConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetValueConverter.cs index d8ac744a9..d78ef0c8e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetValueConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/BrushStopToOffsetValueConverter.cs @@ -20,11 +20,11 @@ namespace Tango.MachineStudio.Developer.Converters if (stop != null && segment != null) { - if (segment.BrushStops.IndexOf(stop) == segment.BrushStops.Count - 1) + if (stop.IsLast) { return 100d; } - else if (segment.BrushStops.IndexOf(stop) == 0) + else if (stop.IsFirst) { return 0d; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToBrushConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToBrushConverter.cs index 8aef260ff..1ac498070 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToBrushConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToBrushConverter.cs @@ -21,7 +21,7 @@ namespace Tango.MachineStudio.Developer.Converters GradientStopCollection stops = new GradientStopCollection(); - foreach (var stop in segment.BrushStops) + foreach (var stop in segment.BrushStops.OrderBy(x => x.StopIndex)) { stops.Add(new GradientStop(stop.Color, stop.OffsetPercent / 100d)); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToBrushConverterMulti.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToBrushConverterMulti.cs index 0248fd730..41c1dd4df 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToBrushConverterMulti.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToBrushConverterMulti.cs @@ -23,7 +23,7 @@ namespace Tango.MachineStudio.Developer.Converters { GradientStopCollection stops = new GradientStopCollection(); - foreach (var stop in segment.BrushStops) + foreach (var stop in segment.BrushStops.OrderBy(x => x.StopIndex)) { stops.Add(new GradientStop(stop.Color, stop.OffsetPercent / 100d)); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToGradientStopsConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToGradientStopsConverter.cs index 37908c940..f28a0b594 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToGradientStopsConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToGradientStopsConverter.cs @@ -20,7 +20,7 @@ namespace Tango.MachineStudio.Developer.Converters GradientStopCollection stops = new GradientStopCollection(); - foreach (var stop in segment.BrushStops) + foreach (var stop in segment.BrushStops.OrderBy(x => x.StopIndex)) { stops.Add(new GradientStop(stop.Color, stop.OffsetPercent / 100d)); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToGradientStopsConverterMulti.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToGradientStopsConverterMulti.cs index 68ff95a9c..c50fbb06c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToGradientStopsConverterMulti.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentToGradientStopsConverterMulti.cs @@ -22,7 +22,7 @@ namespace Tango.MachineStudio.Developer.Converters { GradientStopCollection stops = new GradientStopCollection(); - foreach (var stop in segment.BrushStops) + foreach (var stop in segment.BrushStops.OrderBy(x => x.StopIndex)) { stops.Add(new GradientStop(stop.Color, stop.OffsetPercent / 100d)); } |
