Add MouseAction rendering

This commit is contained in:
Farkas József
2016-10-01 15:21:26 +02:00
parent c382418dbe
commit 58443cefe1
20 changed files with 252 additions and 0 deletions

View File

@@ -0,0 +1 @@
export * from './svg-mouse-scroll-key';

View File

@@ -0,0 +1,9 @@
<svg:use [attr.xlink:href]="mouseIcon" width="20" height="20" x="8" y="25"></svg:use>
<svg:text
[attr.x]="60"
[attr.y]="0"
[attr.text-anchor]="'middle'"
[attr.font-size]="24">
<tspan dy="34"> Scroll </tspan>
</svg:text>
<svg:use [attr.xlink:href]="directionIcon" width="30" height="30" x="35" y="55"></svg:use>

After

Width:  |  Height:  |  Size: 334 B

View File

@@ -0,0 +1,21 @@
import { Component, Input, OnChanges } from '@angular/core';
import { MapperService } from '../../../../services/mapper.service';
@Component({
selector: 'g[svg-mouse-scroll-key]',
template: require('./svg-mouse-scroll-key.html')
})
export class SvgMouseScrollKeyComponent implements OnChanges {
@Input() direction: string;
private mouseIcon: string;
private directionIcon: string;
constructor(private mapper: MapperService) { }
ngOnChanges() {
this.mouseIcon = this.mapper.getIcon('mouse');
this.directionIcon = this.mapper.getIcon(`scroll-${this.direction}`);
}
}