Compare commits
No commits in common. "4e92d717d524c30ff96838a50071652a63395a88" and "f3638d918d79a3d4d7eb932577519b572dd3f897" have entirely different histories.
4e92d717d5
...
f3638d918d
@ -19,10 +19,7 @@ def delete(user, id):
|
|||||||
|
|
||||||
def get(user, id):
|
def get(user, id):
|
||||||
db = database.get_db()
|
db = database.get_db()
|
||||||
obj = db.objects.find_one(ObjectId(id))
|
return db.objects.find_one(ObjectId(id))
|
||||||
if not obj:
|
|
||||||
raise util.errors.NotFound('Object not found')
|
|
||||||
return obj
|
|
||||||
|
|
||||||
def copy_to_project(user, id, project_id):
|
def copy_to_project(user, id, project_id):
|
||||||
db = database.get_db()
|
db = database.get_db()
|
||||||
|
@ -227,7 +227,7 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
return aDate < bDate;
|
return aDate < bDate;
|
||||||
});
|
});
|
||||||
const user = state.users.users.filter(u => state.auth.currentUserId === u._id)[0];
|
const user = state.users.users.filter(u => state.auth.currentUserId === u._id)[0];
|
||||||
const myProjects = state.projects.projects.filter(p => p.owner?.username === user?.username);
|
const myProjects = state.projects.projects.filter(p => p.owner && p.owner.username === user.username);
|
||||||
return { user, myProjects, project, objects, fullProjectPath: `${username}/${projectPath}`, object, comments };
|
return { user, myProjects, project, objects, fullProjectPath: `${username}/${projectPath}`, object, comments };
|
||||||
};
|
};
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
|
@ -59,16 +59,14 @@ class DraftPreview extends Component {
|
|||||||
const weftColourwayCanvas = document.querySelector(`.preview-${id} .weft-colourway`);
|
const weftColourwayCanvas = document.querySelector(`.preview-${id} .weft-colourway`);
|
||||||
const drawdownCanvas = document.querySelector(`.preview-${id} .drawdown`);
|
const drawdownCanvas = document.querySelector(`.preview-${id} .drawdown`);
|
||||||
const tieupsCanvas = document.querySelector(`.preview-${id} .tieups`);
|
const tieupsCanvas = document.querySelector(`.preview-${id} .tieups`);
|
||||||
if (warpCanvas) {
|
ctx.drawImage(warpColourwayCanvas, canvas.width - warpCanvas.width - weft.treadles * baseSize - 20, 0);
|
||||||
ctx.drawImage(warpColourwayCanvas, canvas.width - warpCanvas.width - weft.treadles * baseSize - 20, 0);
|
ctx.drawImage(warpCanvas, canvas.width - warpCanvas.width - weft.treadles * baseSize - 20, 10);
|
||||||
ctx.drawImage(warpCanvas, canvas.width - warpCanvas.width - weft.treadles * baseSize - 20, 10);
|
ctx.drawImage(weftCanvas, canvas.width - 10 - weft.treadles * baseSize, warp.shafts * baseSize + 20);
|
||||||
ctx.drawImage(weftCanvas, canvas.width - 10 - weft.treadles * baseSize, warp.shafts * baseSize + 20);
|
ctx.drawImage(weftColourwayCanvas, canvas.width - 10, warp.shafts * baseSize + 20);
|
||||||
ctx.drawImage(weftColourwayCanvas, canvas.width - 10, warp.shafts * baseSize + 20);
|
ctx.drawImage(tieupsCanvas, canvas.width - weft.treadles * baseSize - 10, 10);
|
||||||
ctx.drawImage(tieupsCanvas, canvas.width - weft.treadles * baseSize - 10, 10);
|
ctx.drawImage(drawdownCanvas, canvas.width - drawdownCanvas.width - weft.treadles * baseSize - 20, warp.shafts * baseSize + 20);
|
||||||
ctx.drawImage(drawdownCanvas, canvas.width - drawdownCanvas.width - weft.treadles * baseSize - 20, warp.shafts * baseSize + 20);
|
|
||||||
|
|
||||||
this.props.onImageLoaded(canvas.toDataURL());
|
this.props.onImageLoaded(canvas.toDataURL());
|
||||||
}
|
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,10 +36,8 @@ class Tieups extends Component {
|
|||||||
const tieups = Object.assign([], this.props.tieups);
|
const tieups = Object.assign([], this.props.tieups);
|
||||||
|
|
||||||
if (tieup >= tieups.length) this.fillUpTo(tieups, tieup);
|
if (tieup >= tieups.length) this.fillUpTo(tieups, tieup);
|
||||||
if (tieups[tieup] !== undefined) {
|
if (tieups[tieup] && tieups[tieup].indexOf(shaft) === -1) tieups[tieup].push(shaft);
|
||||||
if (tieups[tieup].indexOf(shaft) === -1) tieups[tieup].push(shaft);
|
else tieups[tieup].splice(tieups[tieup].indexOf(shaft));
|
||||||
else tieups[tieup].splice(tieups[tieup].indexOf(shaft));
|
|
||||||
}
|
|
||||||
this.props.updatePattern({ tieups });
|
this.props.updatePattern({ tieups });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user