|
@@ -84,33 +84,39 @@ namespace ComPDFKit.Controls.Measure
|
|
|
switch (param.CurrentType)
|
|
|
{
|
|
|
case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
|
|
|
-
|
|
|
- if (param is LineMeasureParam lineMeasureParam)
|
|
|
{
|
|
|
- straightnessProperty.SetAnnotParam(lineMeasureParam, annot, viewControl);
|
|
|
+ if (param is LineMeasureParam lineMeasureParam)
|
|
|
+ {
|
|
|
+ straightnessProperty.SetAnnotParam(lineMeasureParam, annot, viewControl);
|
|
|
+ SetMeasurePanel(straightnessProperty);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- currentPanel = straightnessProperty;
|
|
|
-
|
|
|
break;
|
|
|
+
|
|
|
case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
|
|
|
if (param is PolyLineMeasureParam polyLineMeasureParam)
|
|
|
{
|
|
|
multilineProperty.SetAnnotParam(polyLineMeasureParam, annot, viewControl);
|
|
|
+ SetMeasurePanel(multilineProperty);
|
|
|
+ return;
|
|
|
}
|
|
|
- currentPanel = multilineProperty;
|
|
|
break;
|
|
|
+
|
|
|
case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
|
|
|
- if (param is PolygonMeasureParam polygonMeasureParam)
|
|
|
+ if (param is PolygonMeasureParam polygonMeasureParam && (annot ==null || (annot as CPDFPolygonAnnotation).IsMeasured()))
|
|
|
{
|
|
|
polygonProperty.SetAnnotParam(polygonMeasureParam, annot, viewControl);
|
|
|
+ SetMeasurePanel(polygonProperty);
|
|
|
+ return;
|
|
|
}
|
|
|
- currentPanel = polygonProperty;
|
|
|
break;
|
|
|
+
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- SetMeasurePanel(currentPanel);
|
|
|
+
|
|
|
+ ClearMeasurePanel();
|
|
|
}
|
|
|
|
|
|
private void StraightnessProperty_LineMeasureParamChanged(object sender, LineMeasureParam e)
|
|
@@ -120,6 +126,7 @@ namespace ComPDFKit.Controls.Measure
|
|
|
|
|
|
private void SetMeasurePanel(UIElement newChild)
|
|
|
{
|
|
|
+ currentPanel = newChild;
|
|
|
MeasurePropertyPanel.Child = newChild;
|
|
|
}
|
|
|
|