Opened 10 years ago

Closed 6 years ago

## #14558 closed defect (patchwelcome)

# VML doesn't apply scale transform to stroke

Reported by: | stelapad | Owned by: | Eugene Lazutkin |
---|---|---|---|

Priority: | high | Milestone: | 1.13 |

Component: | DojoX GFX | Version: | 1.7.1 |

Keywords: | vml stroke scale transform | Cc: | |

Blocked By: | Blocking: |

### Description

VML doesn't apply scale transform to stroke.

Test case:

- Open dojox/gfx/demos/data/transform.json
- Change lines 1533-1540 to:

"transform": {

"xx": 0.4, "xy": 0, "yx": 0, "yy": 0.4, "dx": 0, "dy": 0

},

- Change line 1550 to:

"width": 10,

- Run inspector.html and load transform.json, then select "rotated group/blue path"

SVG renderer will show a normal scaled-down blue path as expected. VML renderer scales down path but does not also scale down stroke so path stroke is super thick.

Another test case example (SVG stroke will be thickened as expected but VML will not):

- Change lines 1533-1540 to:

"transform": {

"xx":2, "xy": 0, "yx": 0, "yy": 2, "dx": -400, "dy": -200

},

- Change line 1550 to:

"width": 5,

Once again the SVG renderer correctly scales up the stroke but VML renderer does not.

Here's my interim fix if it helps at all:

- Open vml.js
- In the "dojox.gfx.vml.Shape" section:
- Update the "setStroke" function (for transforms applied directly to shape):

... rn.strokecolor = s.color.toCss(); var matrix = this._getRealMatrix(); if (!this.ranOnce && this.strokeStyle && matrix && matrix.xx && matrix.xx !== 1 && matrix.yy && matrix.xx === matrix.yy) {

this.strokeStyle.width = Math.ceil(this.strokeStyle.width * matrix.xx); this.ranOnce = true; this.setStroke(this.strokeStyle);

} rn.strokeweight = s.width + "px"; ...

- Update the "_applyTransform" function (for transforms applied to group):

... var matrix = this._getRealMatrix(); if (!this.ranOnce && this.strokeStyle && matrix && matrix.xx && matrix.xx !== 1 && matrix.yy && matrix.xx === matrix.yy) {

this.strokeStyle.width = Math.ceil(this.strokeStyle.width * matrix.xx); this.ranOnce = true; this.setStroke(this.strokeStyle);

} if(matrix){ ...

### Change History (1)

### comment:1 Changed 6 years ago by

Milestone: | tbd → 1.12 |
---|---|

Resolution: | → patchwelcome |

Status: | new → closed |

**Note:**See TracTickets for help on using tickets.

Given that no one has shown interest in creating a patch in the past 3+ years, I'm closing this as patchwelcome.