Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrzej Skrodzki committed Feb 13, 2017
1 parent 0b28bc3 commit a408549
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build
coverage
preview/bundle.js
svg-typewriter.js
npm-debug.log
*.log

# IDEs
.idea/
Expand Down
14 changes: 2 additions & 12 deletions src/writers/writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class Writer {

// build and apply transform
let translate = [0, 0];
let rotate = options.textRotation + shearDegree;
const rotate = options.textRotation + shearDegrees;
switch (options.textRotation) {
case 90:
translate = [width + shearCorrection, 0];
Expand All @@ -152,16 +152,6 @@ export class Writer {
}
textArea.attr("transform", `translate(${translate[0]}, ${translate[1]}) rotate(${rotate})`);

// // DEBUG
// textArea.append("rect").attr({
// x: Math.max(0, shearShift),
// y: 0,
// width: shearCorrectedPrimaryDimension,
// height: shearCorrectedSecondaryDimension,
// fill: "none",
// stroke: "blue"
// });

// TODO This has never taken into account the transform at all, so it's
// certainly in the wrong place. Why do we need it?
this.addClipPath(textContainer);
Expand All @@ -173,7 +163,7 @@ export class Writer {
private writeLine(
line: string, g: d3Selection<any>, width: number,
xAlign: string, xOffset: number, yOffset: number) {

const textEl = g.append("text");
textEl.text(line);
xOffset += width * Writer.XOffsetFactor[xAlign];
Expand Down

0 comments on commit a408549

Please sign in to comment.