mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
Fixing SVG2Canvas "dispatch tables"
This commit is contained in:
parent
2a5ce50122
commit
b22973207a
1 changed files with 46 additions and 46 deletions
|
@ -22,52 +22,6 @@ export let strokevalues = {
|
|||
'stroke-opacity': 1
|
||||
};
|
||||
|
||||
//////////////////////////////////////
|
||||
// Dispatch tables
|
||||
//////////////////////////////////////
|
||||
|
||||
let dispatchDrawCmd = {
|
||||
'M': SVG2Canvas.absoulteMove,
|
||||
'm': SVG2Canvas.relativeMove,
|
||||
'L': SVG2Canvas.absoluteLine,
|
||||
'l': SVG2Canvas.relativeLine,
|
||||
'H': SVG2Canvas.absoluteHLine,
|
||||
'h': SVG2Canvas.relativeHLine,
|
||||
'V': SVG2Canvas.absoluteVLine,
|
||||
'v': SVG2Canvas.relativeVLine,
|
||||
'C': SVG2Canvas.absoluteCurve,
|
||||
'c': SVG2Canvas.relativeCurve,
|
||||
'S': SVG2Canvas.absoluteSmooth,
|
||||
's': SVG2Canvas.relativeSmooth,
|
||||
'Q': SVG2Canvas.absoluteQCurve,
|
||||
'q': SVG2Canvas.relativeQCurve,
|
||||
'T': SVG2Canvas.absoluteQSmooth,
|
||||
't': SVG2Canvas.relativeQSmooth,
|
||||
'Z': SVG2Canvas.closePath,
|
||||
'z': SVG2Canvas.closePath
|
||||
};
|
||||
|
||||
let dispatchAbsouluteCmd = {
|
||||
'M': SVG2Canvas.setAbsoluteMove,
|
||||
'm': SVG2Canvas.setRelativeMove,
|
||||
'L': SVG2Canvas.setAbsoluteLine,
|
||||
'l': SVG2Canvas.setRelativeLine,
|
||||
'H': SVG2Canvas.setAbsoluteHLine,
|
||||
'h': SVG2Canvas.setRelativeHLine,
|
||||
'V': SVG2Canvas.setAbsoluteVLine,
|
||||
'v': SVG2Canvas.setRelativeVLine,
|
||||
'C': SVG2Canvas.setAbsoluteCurve,
|
||||
'c': SVG2Canvas.setRelativeCurve,
|
||||
'S': SVG2Canvas.setAbsoluteSmooth,
|
||||
's': SVG2Canvas.setRelativeSmooth,
|
||||
'Q': SVG2Canvas.setAbsoluteQCurve,
|
||||
'q': SVG2Canvas.setRelativeQCurve,
|
||||
'T': SVG2Canvas.setAbsoluteQSmooth,
|
||||
't': SVG2Canvas.setRelativeQSmooth,
|
||||
'Z': SVG2Canvas.setClosePath,
|
||||
'z': SVG2Canvas.setClosePath
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// Drawing Mask and Objects
|
||||
|
@ -1009,3 +963,49 @@ export default class SVG2Canvas {
|
|||
return ['T', endp.x, endp.y];
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Dispatch tables
|
||||
//////////////////////////////////////
|
||||
|
||||
let dispatchDrawCmd = {
|
||||
'M': SVG2Canvas.absoulteMove,
|
||||
'm': SVG2Canvas.relativeMove,
|
||||
'L': SVG2Canvas.absoluteLine,
|
||||
'l': SVG2Canvas.relativeLine,
|
||||
'H': SVG2Canvas.absoluteHLine,
|
||||
'h': SVG2Canvas.relativeHLine,
|
||||
'V': SVG2Canvas.absoluteVLine,
|
||||
'v': SVG2Canvas.relativeVLine,
|
||||
'C': SVG2Canvas.absoluteCurve,
|
||||
'c': SVG2Canvas.relativeCurve,
|
||||
'S': SVG2Canvas.absoluteSmooth,
|
||||
's': SVG2Canvas.relativeSmooth,
|
||||
'Q': SVG2Canvas.absoluteQCurve,
|
||||
'q': SVG2Canvas.relativeQCurve,
|
||||
'T': SVG2Canvas.absoluteQSmooth,
|
||||
't': SVG2Canvas.relativeQSmooth,
|
||||
'Z': SVG2Canvas.closePath,
|
||||
'z': SVG2Canvas.closePath
|
||||
};
|
||||
|
||||
let dispatchAbsouluteCmd = {
|
||||
'M': SVG2Canvas.setAbsoluteMove,
|
||||
'm': SVG2Canvas.setRelativeMove,
|
||||
'L': SVG2Canvas.setAbsoluteLine,
|
||||
'l': SVG2Canvas.setRelativeLine,
|
||||
'H': SVG2Canvas.setAbsoluteHLine,
|
||||
'h': SVG2Canvas.setRelativeHLine,
|
||||
'V': SVG2Canvas.setAbsoluteVLine,
|
||||
'v': SVG2Canvas.setRelativeVLine,
|
||||
'C': SVG2Canvas.setAbsoluteCurve,
|
||||
'c': SVG2Canvas.setRelativeCurve,
|
||||
'S': SVG2Canvas.setAbsoluteSmooth,
|
||||
's': SVG2Canvas.setRelativeSmooth,
|
||||
'Q': SVG2Canvas.setAbsoluteQCurve,
|
||||
'q': SVG2Canvas.setRelativeQCurve,
|
||||
'T': SVG2Canvas.setAbsoluteQSmooth,
|
||||
't': SVG2Canvas.setRelativeQSmooth,
|
||||
'Z': SVG2Canvas.setClosePath,
|
||||
'z': SVG2Canvas.setClosePath
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue