mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
6e1ce724cb
- 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
54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
// TODO(grosbouddha): put under pskl namespace.
|
|
var Constants = {
|
|
DEFAULT : {
|
|
HEIGHT : 32,
|
|
WIDTH : 32,
|
|
FPS : 12
|
|
},
|
|
|
|
MODEL_VERSION : 1,
|
|
|
|
MAX_HEIGHT : 1024,
|
|
MAX_WIDTH : 1024,
|
|
|
|
PREVIEW_FILM_SIZE : 120,
|
|
|
|
DEFAULT_PEN_COLOR : '#000000',
|
|
TRANSPARENT_COLOR : 'TRANSPARENT',
|
|
|
|
/*
|
|
* Fake semi-transparent color used to highlight transparent
|
|
* strokes and rectangles:
|
|
*/
|
|
SELECTION_TRANSPARENT_COLOR: 'rgba(255, 255, 255, 0.6)',
|
|
|
|
/*
|
|
* When a tool is hovering the drawing canvas, we highlight the eventual
|
|
* pixel target with this color:
|
|
*/
|
|
TOOL_TARGET_HIGHLIGHT_COLOR: 'rgba(255, 255, 255, 0.2)',
|
|
|
|
/*
|
|
* Default entry point for piskel web service:
|
|
*/
|
|
STATIC : {
|
|
URL : {
|
|
SAVE : 'http://3.piskel-app.appspot.com/store',
|
|
GET : 'http://3.piskel-app.appspot.com/get'
|
|
}
|
|
},
|
|
APPENGINE : {
|
|
URL : {
|
|
SAVE : 'save'
|
|
}
|
|
},
|
|
IMAGE_SERVICE_UPLOAD_URL : 'http://screenletstore.appspot.com/__/upload',
|
|
IMAGE_SERVICE_GET_URL : 'http://screenletstore.appspot.com/img/',
|
|
|
|
GRID_STROKE_WIDTH: 1,
|
|
ZOOMED_OUT_BACKGROUND_COLOR : '#A0A0A0',
|
|
|
|
LEFT_BUTTON : 'left_button_1',
|
|
RIGHT_BUTTON : 'right_button_2',
|
|
MOUSEMOVE_THROTTLING : 10
|
|
}; |