Commit 9a146f77 authored by Oleg Korshul's avatar Oleg Korshul

line staert/end for dashed shapes

parent 24840b86
...@@ -339,6 +339,17 @@ CShapeDrawer.prototype = ...@@ -339,6 +339,17 @@ CShapeDrawer.prototype =
this.max_y = y; this.max_y = y;
}, },
CheckDash : function()
{
if (this.Ln.prstDash != null && AscCommon.DashPatternPresets[this.Ln.prstDash])
{
var _arr = AscCommon.DashPatternPresets[this.Ln.prstDash].slice();
for (var indexD = 0; indexD < _arr.length; indexD++)
_arr[indexD] *= this.StrokeWidth;
this.Graphics.p_dash(_arr);
}
},
fromShape2 : function(shape, graphics, geom) fromShape2 : function(shape, graphics, geom)
{ {
this.fromShape(shape, graphics); this.fromShape(shape, graphics);
...@@ -492,14 +503,8 @@ CShapeDrawer.prototype = ...@@ -492,14 +503,8 @@ CShapeDrawer.prototype =
this.StrokeWidth /= 36000.0; this.StrokeWidth /= 36000.0;
this.p_width(1000 * this.StrokeWidth); this.p_width(1000 * this.StrokeWidth);
if (this.Ln.prstDash != null && AscCommon.DashPatternPresets[this.Ln.prstDash]) this.CheckDash();
{
var _arr = AscCommon.DashPatternPresets[this.Ln.prstDash].slice();;
for (var indexD = 0; indexD < _arr.length; indexD++)
_arr[indexD] *= this.StrokeWidth;
this.Graphics.p_dash(_arr);
}
if (graphics.IsSlideBoundsCheckerType && !this.bIsNoStrokeAttack) if (graphics.IsSlideBoundsCheckerType && !this.bIsNoStrokeAttack)
graphics.LineWidth = this.StrokeWidth; graphics.LineWidth = this.StrokeWidth;
...@@ -1063,6 +1068,7 @@ CShapeDrawer.prototype = ...@@ -1063,6 +1068,7 @@ CShapeDrawer.prototype =
if (arr != null && arr.length > 1 && this.IsCurrentPathCanArrows === true) if (arr != null && arr.length > 1 && this.IsCurrentPathCanArrows === true)
{ {
this.IsArrowsDrawing = true; this.IsArrowsDrawing = true;
this.Graphics.p_dash(null);
// значит стрелки есть. теперь: // значит стрелки есть. теперь:
// определяем толщину линии "как есть" // определяем толщину линии "как есть"
// трансформируем точки в окончательные. // трансформируем точки в окончательные.
...@@ -1153,6 +1159,7 @@ CShapeDrawer.prototype = ...@@ -1153,6 +1159,7 @@ CShapeDrawer.prototype =
} }
} }
this.IsArrowsDrawing = false; this.IsArrowsDrawing = false;
this.CheckDash();
} }
}, },
...@@ -1356,6 +1363,7 @@ CShapeDrawer.prototype = ...@@ -1356,6 +1363,7 @@ CShapeDrawer.prototype =
if (arr != null && arr.length > 1 && this.IsCurrentPathCanArrows === true) if (arr != null && arr.length > 1 && this.IsCurrentPathCanArrows === true)
{ {
this.IsArrowsDrawing = true; this.IsArrowsDrawing = true;
this.Graphics.p_dash(null);
// значит стрелки есть. теперь: // значит стрелки есть. теперь:
// определяем толщину линии "как есть" // определяем толщину линии "как есть"
// трансформируем точки в окончательные. // трансформируем точки в окончательные.
...@@ -1424,6 +1432,7 @@ CShapeDrawer.prototype = ...@@ -1424,6 +1432,7 @@ CShapeDrawer.prototype =
} }
} }
this.IsArrowsDrawing = false; this.IsArrowsDrawing = false;
this.CheckDash();
} }
} }
}, },
......
...@@ -339,6 +339,17 @@ CShapeDrawer.prototype = ...@@ -339,6 +339,17 @@ CShapeDrawer.prototype =
this.max_y = y; this.max_y = y;
}, },
CheckDash : function()
{
if (this.Ln.prstDash != null && AscCommon.DashPatternPresets[this.Ln.prstDash])
{
var _arr = AscCommon.DashPatternPresets[this.Ln.prstDash].slice();
for (var indexD = 0; indexD < _arr.length; indexD++)
_arr[indexD] *= this.StrokeWidth;
this.Graphics.p_dash(_arr);
}
},
fromShape2 : function(shape, graphics, geom) fromShape2 : function(shape, graphics, geom)
{ {
this.fromShape(shape, graphics); this.fromShape(shape, graphics);
...@@ -466,13 +477,7 @@ CShapeDrawer.prototype = ...@@ -466,13 +477,7 @@ CShapeDrawer.prototype =
this.p_width(1000 * this.StrokeWidth); this.p_width(1000 * this.StrokeWidth);
if (this.Ln.prstDash != null && AscCommon.DashPatternPresets[this.Ln.prstDash]) this.CheckDash();
{
var _arr = AscCommon.DashPatternPresets[this.Ln.prstDash].slice();;
for (var indexD = 0; indexD < _arr.length; indexD++)
_arr[indexD] *= this.StrokeWidth;
this.Graphics.p_dash(_arr);
}
if (graphics.IsSlideBoundsCheckerType && !this.bIsNoStrokeAttack) if (graphics.IsSlideBoundsCheckerType && !this.bIsNoStrokeAttack)
graphics.LineWidth = this.StrokeWidth; graphics.LineWidth = this.StrokeWidth;
...@@ -1052,6 +1057,7 @@ CShapeDrawer.prototype = ...@@ -1052,6 +1057,7 @@ CShapeDrawer.prototype =
if (arr != null && arr.length > 1 && this.IsCurrentPathCanArrows === true) if (arr != null && arr.length > 1 && this.IsCurrentPathCanArrows === true)
{ {
this.IsArrowsDrawing = true; this.IsArrowsDrawing = true;
this.Graphics.p_dash(null);
// значит стрелки есть. теперь: // значит стрелки есть. теперь:
// определяем толщину линии "как есть" // определяем толщину линии "как есть"
// трансформируем точки в окончательные. // трансформируем точки в окончательные.
...@@ -1142,6 +1148,7 @@ CShapeDrawer.prototype = ...@@ -1142,6 +1148,7 @@ CShapeDrawer.prototype =
} }
} }
this.IsArrowsDrawing = false; this.IsArrowsDrawing = false;
this.CheckDash();
} }
}, },
...@@ -1356,6 +1363,7 @@ CShapeDrawer.prototype = ...@@ -1356,6 +1363,7 @@ CShapeDrawer.prototype =
if (arr != null && arr.length > 1 && this.IsCurrentPathCanArrows === true) if (arr != null && arr.length > 1 && this.IsCurrentPathCanArrows === true)
{ {
this.IsArrowsDrawing = true; this.IsArrowsDrawing = true;
this.Graphics.p_dash(null);
// значит стрелки есть. теперь: // значит стрелки есть. теперь:
// определяем толщину линии "как есть" // определяем толщину линии "как есть"
// трансформируем точки в окончательные. // трансформируем точки в окончательные.
...@@ -1424,6 +1432,7 @@ CShapeDrawer.prototype = ...@@ -1424,6 +1432,7 @@ CShapeDrawer.prototype =
} }
} }
this.IsArrowsDrawing = false; this.IsArrowsDrawing = false;
this.CheckDash();
} }
} }
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment