Commit Graph

52 Commits

Author SHA1 Message Date
jdescottes
e4cf2ac40b Merged 2013-12-18 23:22:25 +01:00
juliandescottes
b77f7057d7 save-panel : added piskel descriptor 2013-12-10 21:25:36 +01:00
juliandescottes
ce111be5c8 Merging from master after PR zoom level 2013-11-23 19:25:51 +01:00
jdescottes
e68ae7f31d feature : zoom level : code review
+ Switched from BITWISE OR 0 (x | 0) to Math.floor for readability
2013-11-15 00:39:43 +01:00
jdescottes
3af64d3f45 feature : zoom level : code review
+ added explanatory comment for CanvasUtils.disableImageSmoothing
+ detect browser for chosing wheel/mousewheel event in DrawingController
+ create ABSTRACT_FUNCTION constant to be reused forabstract methods
2013-11-15 00:32:18 +01:00
jdescottes
86cd1cdeaa fix : reduce piskel model size
+ moved Serializer and Deserializer to utils.serialization package
+ put all backward code in utils.serialization.backward
+ added static method on Deserializer to make its usage similar to other
  utils in the package
- still not happy with the names used in Deserializer classes
  (deserializer.deserialize ...)
2013-11-15 00:03:05 +01:00
jdescottes
4a1a7b6c2b fix : reduce piskel model size : ImportController
+ ImportController is no longer relying on the deserializer to build a
  piskel instance
+ Static builders have been added to Piskel and Layer to help easily
  create new instances from existing elements
2013-11-14 23:03:29 +01:00
jdescottes
e9a2ccfd1d fix : reduce piskel model size : fix import feature 2013-11-13 23:51:27 +01:00
jdescottes
df4978f6af fix : reduce piskel model size
+ piskel deserialization is now clearly asynchronous
+ added utils.Deserializer (not a singleton though, more a builder/loader)
+ utils.Deserializer constructor expects a callback
+ when all layers are loaded and piskel is ready, the callback provided by
  the client is called with piskel as the first argument
- Deserializer doesn't fit in the utils package, which should be reserved
  to singletons : can move it to service as a PiskelLoaderService, and
  Deserializer could remain with only the purely static methods
- ImportController is realying on the Deserializer to build a Piskel but
  it shouldn't. Find a way to mutualize the code necessary to create a
  Piskel from an array of pskl.model.Frame
- still cleanup to do in app.js
- comments to add as well
2013-11-13 23:39:43 +01:00
jdescottes
781abb735b fix : reduce piskel model size
- added backward compatible implementation for v1 models
2013-11-13 22:57:07 +01:00
jdescottes
4f54715f70 fix : reduce piskel model size
- Initial implementation : working but ...
- MODEL_VERSION has been bumped to 2
- The loading process is now theoretically asynchronous (loading images to
  read the content of the layers), but for now, the asynchronous behaviour
  is hidden behind a nasty hack, which is somehow similar to lazy loading.
  When loading the piskel, a Piskel is created synchronously, with fake
  empty frames, and as the images will get loaded, the fake frames will be
  replaced by the actual frames.

  I really don't like this, and the asynchronous nature of the loading
  should be clearly expressed
- There is no backward compatible deserializer for the previous version of
  the model (1)
- The Serializer utils is just badly designed. Serialization and
  deserialization should be splitted into two different classes
- Saving & loading are still done in app.js and should be moved to
  services

BUT : the size of the piskels is now pretty small. A piskel which was
using 890kB previously is now using only 10kB. Although it should be
noted, that after gzip there is no significant difference between this
version and the existing one. The only gains we can really expect with
this are : less disk space used on appengine, ability to reuse the
layers' pngs directly on piskel-website (but to be honest I can't see any
valid use case for this)
2013-11-08 00:44:24 +01:00
jdescottes
c8a8d470a7 renamed all references to dpi to zoom for consistency (also wtf dpi anyway !) 2013-11-05 22:11:47 +01:00
jdescottes
6e1ce724cb feature : zoom level
- fix : removed duplicated code between ImageResizer and CanvasUtils
  (disabledImageSmoothing utility method)
- added pskl.utils.UserAgent, basic user agent sniffer. I need it to sniff
  out IE10 for frame rendering (and it's not possible to feature detect
  here). Can check isChrome, isFirefox, isIE and get the version for each
  of them
- added resizeNearestNeighbour in ImageResizer. Readapted from piskel
  website, this allows us to 1 - resize without AA on IE10, and 2 - add a
  pixel gap to reenable the GRID
- finally : added back support for GRID !
- also extracted the 'zoomed out background color' as a constant in
  Constant.js
2013-11-05 00:05:49 +01:00
jdescottes
8a380b6c78 merged from master 2013-11-01 23:37:09 +01:00
jdescottes
bd99027852 feature : zoom
- Added MinimapController that displays a frame on the animated preview
  when zoomed in
- Added bounds for the offset to make sure it doesn't go crazy
- Added new utility Math.js with a minmax function
- TODO : the minimap controller has a lot of dependencies, see if could be
  cleaned up
- TODO : DrawingController knows the size of the picture it has to render
  only indirectly, which makes it hard in some cases (such as boundary
  checking performed during setOffset)
2013-11-01 23:11:11 +01:00
jdescottes
b7e8310b61 feature : zoom : continued
- simplified Renderer(s) architecture (removed decorator,
  CachedFrameRenderer simply inherits from FrameRenderer now)
- keeping AbstractRenderer to act as interface
- fixed issue with layers : forgot to clone the first frame while merging
  and therefore was modifying the original frame when I just wanted to
  create a tmp frame (FrameUtils.js)
- extracted the mousemove throttling delay used in DrawingController to
  Constants.js and reduced it from 40ms to 10ms
2013-11-01 16:27:23 +01:00
jdescottes
3ce9aaa843 Added utilities for alpha-composition in FrameUtils, for future usage ... maybe 2013-11-01 11:17:50 +01:00
jdescottes
7490651f83 Zoom initial implementation. No UI, only bound to mousewheel. Everything is broken, to amend ! 2013-10-29 22:16:39 +01:00
jdescottes
a0a1fa7bdf Added preview picture. Added a flow : start with only file input enabled 2013-10-23 23:34:09 +02:00
jdescottes
3dde3504d1 Synchronize resize fields, resize image when importing 2013-10-23 01:01:35 +02:00
jdescottes
07cb37f2bf Merge branch 'master' into import-picture-panel 2013-10-16 23:15:09 +02:00
jdescottes
1156008213 Import from file 2013-10-16 23:14:41 +02:00
Julian Descottes
4527846ad6 PR138#commitcomment-4293036 use full namespace when specifying a classtype
See https://github.com/juliandescottes/piskel/pull/138#commitcomment-4293036
2013-10-10 13:35:18 +02:00
jdescottes
55e3607ecc Cleanup of saving/loading process 2013-10-10 00:06:11 +02:00
jdescottes
17a147c880 grrmml 2013-10-04 23:55:45 +02:00
jdescottes
5502d75ca5 Layers:Added backward compatibility for previous models 2013-10-04 22:59:42 +02:00
jdescottes
2686a2e944 Layers:Review:Removed grid drawing routine : was never drawn 2013-09-30 22:44:02 +02:00
Julian Descottes
ca427e0853 Dev environment : closure compiler + jshint update
Fixed error raised by closure compiler
Added es3 option to jshint (detect trailing commas)
Added curly option to jshint (missing curly braces for if/for blocks)
Removed trailing whitespaces (not enforced through jshint though)
2013-09-28 23:52:51 +02:00
Julian Descottes
b254c582b9 Merge branch 'master' into feature-gif-export-panel 2013-09-28 23:37:12 +02:00
Vince
38dc1dc9fe Closure Compiler: Fix All The things !
- Adding some small fixes to pass compile step (mostly /** instead of
/*).
  - Adding some closure externs
2013-09-28 21:10:12 +02:00
jdescottes
3a8d96f840 Arrow icons update 2013-09-26 07:47:11 +02:00
jdescottes
6528c7724b Issue 24 : Layers
!! NOT STABLE !!
Initial implementation. No UI update yet.
Check js/model/Piskel.js and js/model/Layer.js for an overview of the new
API.

Piskels can be saved on the existing service.

Previous piskels cannot be loaded. This should be fixed soon.
2013-09-22 21:02:43 +02:00
jdescottes
4f6863eb8a Gif export panel first draft 2013-09-07 17:50:43 +02:00
jdescottes
c23de31e07 Merge from master + bugfixing on b64 2013-08-10 14:47:26 +02:00
jdescottes
87a68bfe21 Dev environment:force indentation to 2 spaces. Added new grunt module, grunt-leading-indent to check space consistency, and modified jshint options to enforce 2 spaces 2013-08-10 12:11:16 +02:00
jdescottes
a16e1bab09 added Function.prototype.bind polyfill for PhantomJS. Make Casper happy. 2013-08-04 21:20:25 +02:00
Vince
7bbcbe1861 Review comments 2013-06-19 01:51:53 +02:00
Vince
5913b19641 Plug canvas background settings on UserSettings storage
Canvas background class are now manager at the FrameRenderer level
instead of CSS classes at the top of the DOM.
2013-06-17 23:10:35 +02:00
Vince
2691b23c09 Fix cache typo in UserSettings 2013-06-17 21:23:21 +02:00
Vince
9a3a87bd57 Fix travis 2013-06-17 21:03:22 +02:00
Vince
1d4ff1d2de Create an event based UserSettings and use it for the grid diplay state. 2013-06-17 20:24:27 +02:00
Vince
889d5c0d53 Add basic UserSettings persistence static utility.
Based on localStorage for now.
2013-06-17 19:54:43 +02:00
grosbouddha
fba6693426 Make jshint quiet now 2013-05-27 23:42:53 +02:00
juliandescottes
562d669ae1 Basic export - opening new window with concatenated spritesheet in PNG format 2012-09-20 00:43:39 +02:00
juliandescottes
0f0938b91b Changed case of PixelUtils 2012-09-19 23:12:55 +02:00
juliandescottes
0d1775b24c Dynamic size for frame 2012-09-16 18:48:32 +02:00
Vince
36476d5871 clean comments 2012-09-16 00:47:41 +02:00
Vince
277fd979e9 master conflict merge 2012-09-15 02:24:06 +02:00
Vince
28835f96f3 Cleaning a bit pixel utils + fix empty paste bug 2012-09-15 01:01:47 +02:00
juliandescottes
813b60b854 Simplified Rectangle.js and pixelUtils 2012-09-14 22:20:00 +02:00