12 Commits

6 changed files with 39 additions and 18 deletions

View File

@ -1,8 +1,6 @@
Piskel
======
[![Greenkeeper badge](https://badges.greenkeeper.io/juliandescottes/piskel.svg)](https://greenkeeper.io/)
[![Travis Status](https://api.travis-ci.org/juliandescottes/piskel.png?branch=master)](https://travis-ci.org/juliandescottes/piskel) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
A simple web-based tool for Spriting and Pixel art.

View File

@ -6,6 +6,8 @@ const fse = require('fs-extra');
const PISKEL_PATH = path.resolve(__dirname, '..');
const PISKELAPP_PATH = path.resolve(__dirname, '../../piskel-website');
var pjson = require('../package.json');
// Callbacks sorted by call sequence.
function onCopy(err) {
if (err) {
@ -52,6 +54,17 @@ function onDeleteTempPartial(err) {
}
console.log('Temporary main partial deleted...');
fs.writeFile(path.resolve(PISKELAPP_PATH, "static/editor/VERSION"), pjson.version, onVersionFileCreated);
}
function onVersionFileCreated(err) {
if (err) {
console.error('Failed to create temporary main partial...');
return console.error(err);
}
console.log('Version file created...');
console.log('Finished!');
}

View File

@ -1,6 +1,6 @@
{
"name": "piskel",
"version": "0.10.0",
"version": "0.10.1",
"description": "Pixel art editor",
"author": "Julian Descottes <julian.descottes@gmail.com>",
"contributors": [
@ -29,7 +29,7 @@
"devDependencies": {
"dateformat": "2.0.0",
"fs-extra": "3.0.1",
"grunt": "^1.0.1",
"grunt": "0.4.5",
"grunt-casperjs": "^2.2.1",
"grunt-contrib-clean": "1.1.0",
"grunt-contrib-concat": "1.0.1",
@ -38,9 +38,9 @@
"grunt-contrib-jshint": "1.1.0",
"grunt-contrib-uglify": "2.3.0",
"grunt-contrib-watch": "1.0.0",
"grunt-include-replace": "5.0.0",
"grunt-jscs": "3.0.1",
"grunt-karma": "2.0.0",
"grunt-include-replace": "4.0.1",
"grunt-jscs": "2.8.0",
"grunt-karma": "1.0.0",
"grunt-leading-indent": "0.2.0",
"grunt-nw-builder": "3.1.0",
"grunt-open": "0.2.3",
@ -48,10 +48,9 @@
"grunt-spritesmith": "6.4.0",
"jasmine-core": "2.6.1",
"karma": "1.7.0",
"karma-chrome-launcher": "2.1.1",
"karma-jasmine": "1.1.0",
"karma-phantomjs-launcher": "1.0.4",
"load-grunt-tasks": "3.5.2",
"load-grunt-tasks": "3.5.0",
"phantomjs": "2.1.7",
"phantomjs-polyfill-object-assign": "0.0.2",
"promise-polyfill": "6.0.2",

View File

@ -140,7 +140,8 @@
title : title,
icon : descriptor.iconClass,
description : description,
key : this.formatKey_(shortcut.getDisplayKey()),
// Avoid sanitization
'!key!' : this.formatKey_(shortcut.getDisplayKey()),
className : shortcutClasses.join(' ')
});

View File

@ -252,14 +252,24 @@
var displayContext = this.displayCanvas.getContext('2d');
displayContext.save();
// Draw background
displayContext.fillStyle = Constants.ZOOMED_OUT_BACKGROUND_COLOR;
displayContext.fillRect(0, 0, this.displayCanvas.width - 1, this.displayCanvas.height - 1);
var translateX = this.margin.x - this.offset.x * z;
var translateY = this.margin.y - this.offset.y * z;
displayContext.translate(
this.margin.x - this.offset.x * z,
this.margin.y - this.offset.y * z
);
var isZoomedOut = translateX > 0 || translateY > 0;
// Draw the background / zoomed-out color only if needed. Otherwise the clearRect
// happening after that will clear "out of bounds" and seems to be doing nothing
// on some chromebooks (cf https://github.com/juliandescottes/piskel/issues/651)
if (isZoomedOut) {
// Draw background
displayContext.fillStyle = Constants.ZOOMED_OUT_BACKGROUND_COLOR;
// The -1 on the width and height here is a workaround for a Chrome-only bug
// that was potentially fixed, but is very hardware dependant. Seems to be
// triggered when doing clear rect or fill rect using the full width & height
// of a canvas. (https://bugs.chromium.org/p/chromium/issues/detail?id=469906)
displayContext.fillRect(0, 0, this.displayCanvas.width - 1, this.displayCanvas.height - 1);
}
displayContext.translate(translateX, translateY);
// Scale up to draw the canvas content
displayContext.scale(z, z);

View File

@ -43,7 +43,7 @@
<script type="text/template" id="cheatsheet-shortcut-template">
<li class="cheatsheet-shortcut {{className}}" data-shortcut-id="{{id}}">
<div class="cheatsheet-icon {{icon}}"></div>
<span class="cheatsheet-key" rel="tooltip" data-placement="top" title="{{title}}">{{key}}</span>
<span class="cheatsheet-key" rel="tooltip" data-placement="top" title="{{title}}">{{!key!}}</span>
<span class="cheatsheet-description">{{description}}</span>
</li>
</script>