Integrated snap.svg and starting to render content

This commit is contained in:
Jeff Avallone
2014-11-30 10:48:33 -05:00
parent 57c0de7668
commit 301dce5873
7 changed files with 55 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
grammar JavascriptRegexp
root <- ( ( "/" regexp "/" fl:[igm]* ) / regexp ) <Root>
regexp <- match ( "|" regexp )? <Regexp>
regexp <- match ( "|" match )* <Regexp>
match <- anchor_start? ( ( subexp / charset / terminal ) repeat? )* anchor_end?
anchor_start <- "^"
anchor_end <- "$"
+33
View File
@@ -1,4 +1,37 @@
export default {
render(container) {
this.rect = this.container.rect().attr({
x: 5,
y: 5,
rx: 10,
ry: 10,
fill: '#f00'
});
this.text = this.container.text(0, 0, this.textValue).attr({
fill: '#fff',
fontWeight: 'bold'
});
},
position() {
var box = this.text.getBBox();
this.container.attr({
width: box.width + 20,
height: box.height + 20
});
this.text.attr({
x: 10,
y: box.height + 5
});
this.rect.attr({
width: box.width + 10,
height: box.height + 10
});
},
flags() {
var flags;