zwischen commit
This commit is contained in:
parent
753cb7845d
commit
fdbbf71cc7
3 changed files with 13 additions and 9 deletions
|
|
@ -79,7 +79,7 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
|||
handleFill: "red",
|
||||
handleStrokeDashPreset: [5,5],
|
||||
handleStrokeWidth: 2,
|
||||
handleLength: 18,
|
||||
handleLength: 10,
|
||||
handleRadius: 16,
|
||||
unscale: 1,
|
||||
handleStrokeDash: "5,5",
|
||||
|
|
@ -135,7 +135,7 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
|||
this.data("ty", 0);
|
||||
this.attr({class:'_freeTransformInProgress'});
|
||||
|
||||
ftOption.unscale = 1 / this.paper.select('#scaleGroup').transform().localMatrix.a;
|
||||
ftOption.unscale = 1 / this.paper.select('#scaleGroup').transform().globalMatrix.a;
|
||||
this.data('unscale', ftOption.unscale);
|
||||
ftOption.handleStrokeDash = ftOption.handleStrokeDashPreset.map(function(v){ return v*ftOption.unscale; }).join(',');
|
||||
return this;
|
||||
|
|
@ -298,7 +298,7 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
|||
if(!mainEl.data('block_rotation')){
|
||||
var angle = Snap.angle( mainBB.cx, mainBB.cy, handle.attr('cx'), handle.attr('cy') ) - 180;
|
||||
if(event.shiftKey){
|
||||
angle = Math.round(angle/30) * 30;
|
||||
angle = Math.round(angle/15) * 15;
|
||||
}
|
||||
mainEl.data("angle", angle );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ $(function(){
|
|||
self.scaleMatrix = ko.computed(function(){
|
||||
var m = new Snap.Matrix();
|
||||
//var factor = 25.4/self.svgDPI() * 1/self.px2mm_factor();
|
||||
var factor = 1
|
||||
var factor = 1;
|
||||
if(!isNaN(factor)){
|
||||
m.scale(factor);
|
||||
return m;
|
||||
|
|
@ -239,8 +239,9 @@ $(function(){
|
|||
}
|
||||
|
||||
// scale matrix
|
||||
var scale = self.svgDPI()/25.4;
|
||||
var mat = self.getDocumentViewBoxMatrix(doc_width, doc_height, doc_viewbox);
|
||||
var scaleMatrixStr = new Snap.Matrix(mat[0][0],mat[0][1],mat[1][0],mat[1][1],mat[0][2],mat[1][2]).toTransformString();
|
||||
var scaleMatrixStr = new Snap.Matrix(mat[0][0]/scale,mat[0][1],mat[1][0],mat[1][1]/scale,mat[0][2],mat[1][2]).toTransformString();
|
||||
newSvgAttrs['transform'] = scaleMatrixStr;
|
||||
|
||||
var newSvg = snap.group(f.selectAll("svg>*"));
|
||||
|
|
@ -582,10 +583,10 @@ $(function(){
|
|||
var yPatternOffset = self.workingAreaHeightMM() % linedistMM;
|
||||
var linedist = linedistMM;
|
||||
|
||||
var marker = snap.circle(linedist/2, linedist/2, self.px2mm(1)).attr({
|
||||
var marker = snap.circle(linedist/2, linedist/2, 1).attr({
|
||||
fill: "#000000",
|
||||
stroke: "none",
|
||||
strokeWidth: self.px2mm(1)
|
||||
strokeWidth: 1
|
||||
});
|
||||
|
||||
// dot pattern
|
||||
|
|
|
|||
|
|
@ -287,6 +287,9 @@
|
|||
backgroundPosition: crosshairX()+'px'+' '+crosshairY()+'px',
|
||||
width: workingAreaWidthPx()+'px',
|
||||
height: workingAreaHeightPx()+'px'
|
||||
},
|
||||
attr: {
|
||||
viewBox: '0 0 '+workingAreaWidthMM()+' '+workingAreaHeightMM()
|
||||
}
|
||||
">
|
||||
<filter id="grayscale_filter">
|
||||
|
|
@ -321,8 +324,8 @@
|
|||
<tspan
|
||||
x="368.571426" y="712.36218" id="tspan2991"
|
||||
style="text-anchor:middle;text-align:center" /></text>
|
||||
<g id="placedGcodes" data-bind="visible: !state.isPrinting() && !state.isPaused(), attr: { transform: scaleMatrixMMtoDisplay() }"></g>
|
||||
<g id="gCodePreview" data-bind="visible: state.isPrinting() || state.isPaused(), attr: { transform: scaleMatrixMMtoDisplay() }"></g>
|
||||
<g id="placedGcodes" data-bind="visible: !state.isPrinting() && !state.isPaused()"></g>
|
||||
<g id="gCodePreview" data-bind="visible: state.isPrinting() || state.isPaused()"></g>
|
||||
<rect data-bind="click: move_laser"
|
||||
id="coordGrid" x="0" y="0" width="0" height="0"
|
||||
stroke="none" fill="none"></rect>
|
||||
|
|
|
|||
Loading…
Reference in a new issue