Skip to content

Commit

Permalink
handle fill opacity for text
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminDobler committed Apr 27, 2017
1 parent cc74ba3 commit c793f2a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,23 @@ export class SketchTextComponent implements OnInit {
this.properties.height = this._data.frame.height;
this.properties.transform = this._data.$$transform;//this.sketchService.getTransformation(this._data);
this.properties.mask = 'url(#mask' + this._data.maskId + ')';
this.properties.fillOpacity = this._data.$$fillOpacity;
}

ngOnInit() {
}


@HostBinding('attr.fill')
public get fill(): string {
public get fillOpacity(): string {
return this.properties.fill;
}

@HostBinding('attr.fill-opacity')
public get fill(): string {
return this.properties.fillOpacity;
}

@HostBinding('attr.font-size')
public get fontSize(): string {
return this.properties.fontSize;
Expand Down
4 changes: 4 additions & 0 deletions src/app/services/sketch.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,13 @@ export class SketchService {
colors.red = parseFloat(colorArray[0]);
colors.green = parseFloat(colorArray[1]);
colors.blue = parseFloat(colorArray[2]);
if (colorArray.length>3) {
data.$$fillOpacity = parseFloat(colorArray[3]);
}
data.$$fontColor = this.colorToHex(colors);
} else {
data.$$fontColor = '#000000';
data.$$fillOpacity = 1;

}

Expand Down

0 comments on commit c793f2a

Please sign in to comment.