Rendering CharsetRange
This commit is contained in:
parent
fadfaee440
commit
e99c284216
@ -2,5 +2,36 @@ import _ from 'lodash';
|
||||
import Base from './base.js';
|
||||
|
||||
export default _.extend({}, Base, {
|
||||
type: 'charset_range'
|
||||
type: 'charset_range',
|
||||
|
||||
render() {
|
||||
this.first.container = this.container.group();
|
||||
this.first.render();
|
||||
|
||||
this.last.container = this.container.group();
|
||||
this.last.render();
|
||||
|
||||
this.hyphen = this.container.text()
|
||||
.attr({
|
||||
text: '-'
|
||||
});
|
||||
},
|
||||
|
||||
position() {
|
||||
var box;
|
||||
|
||||
this.first.position();
|
||||
this.last.position();
|
||||
|
||||
this.first.container.transform(Snap.matrix()
|
||||
.translate(0, 0));
|
||||
|
||||
box = this.first.container.getBBox();
|
||||
this.hyphen.transform(Snap.matrix()
|
||||
.translate(box.x2 + 5, box.cy - this.hyphen.getBBox().cy));
|
||||
|
||||
box = this.hyphen.getBBox();
|
||||
this.last.container.transform(Snap.matrix()
|
||||
.translate(box.x2 + 5, 0));
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user