mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Rename project/ProjectView -> ui/View.
This commit is contained in:
parent
7b4dd222ac
commit
26269d394a
6 changed files with 9 additions and 9 deletions
|
@ -142,7 +142,7 @@ var PaperScript = this.PaperScript = new function() {
|
|||
paper = scope;
|
||||
new Project();
|
||||
// Activate the newly created view straight away
|
||||
new ProjectView(canvas).activate();
|
||||
new View(canvas).activate();
|
||||
}
|
||||
if (code.src) {
|
||||
// If we're loading from a source, request that first and then
|
||||
|
|
|
@ -665,7 +665,7 @@ var Item = this.Item = Base.extend({
|
|||
}
|
||||
},
|
||||
|
||||
// TODO: Implement ProjectView into the drawing
|
||||
// TODO: Implement View into the drawing
|
||||
// TODO: Optimize temporary canvas drawing to ignore parts that are
|
||||
// outside of the visible view.
|
||||
draw: function(item, ctx, param) {
|
||||
|
|
|
@ -35,7 +35,6 @@ var sources = [
|
|||
'src/basic/Matrix.js',
|
||||
'src/basic/Line.js',
|
||||
|
||||
'src/project/ProjectView.js',
|
||||
'src/project/Project.js',
|
||||
'src/project/Symbol.js',
|
||||
|
||||
|
@ -73,6 +72,7 @@ var sources = [
|
|||
'src/browser/DomElement.js',
|
||||
'src/browser/DomEvent.js',
|
||||
|
||||
'src/ui/View.js',
|
||||
'src/ui/Event.js',
|
||||
'src/ui/KeyEvent.js',
|
||||
'src/ui/Key.js',
|
||||
|
|
|
@ -52,7 +52,6 @@ var paper = new function() {
|
|||
//#include "basic/Matrix.js"
|
||||
//#include "basic/Line.js"
|
||||
|
||||
//#include "project/ProjectView.js"
|
||||
//#include "project/Project.js"
|
||||
//#include "project/Symbol.js"
|
||||
|
||||
|
@ -93,6 +92,7 @@ var paper = new function() {
|
|||
//#include "browser/DomElement.js"
|
||||
//#include "browser/DomEvent.js"
|
||||
|
||||
//#include "ui/View.js"
|
||||
//#include "ui/Event.js"
|
||||
//#include "ui/KeyEvent.js"
|
||||
//#include "ui/Key.js"
|
||||
|
|
|
@ -65,7 +65,7 @@ var Key = this.Key = new function() {
|
|||
var character = String.fromCharCode(charCode),
|
||||
key = keys[keyCode] || character.toLowerCase(),
|
||||
handler = down ? 'onKeyDown' : 'onKeyUp',
|
||||
scope = ProjectView.focused && ProjectView.focused._scope,
|
||||
scope = View.focused && View.focused._scope,
|
||||
tool = scope && scope.tool;
|
||||
keyMap[key] = down;
|
||||
if (tool && tool[handler]) {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
var ProjectView = this.ProjectView = Base.extend({
|
||||
var View = this.View = Base.extend({
|
||||
beans: true,
|
||||
|
||||
// TODO: Add bounds parameter that defines position within canvas?
|
||||
|
@ -84,8 +84,8 @@ var ProjectView = this.ProjectView = Base.extend({
|
|||
this._events = this._createEvents();
|
||||
DomEvent.add(this._canvas, this._events);
|
||||
// Make sure the first view is focused for keyboard input straight away
|
||||
if (!ProjectView.focused)
|
||||
ProjectView.focused = this;
|
||||
if (!View.focused)
|
||||
View.focused = this;
|
||||
},
|
||||
|
||||
getViewBounds: function() {
|
||||
|
@ -273,7 +273,7 @@ var ProjectView = this.ProjectView = Base.extend({
|
|||
|
||||
function mousedown(event) {
|
||||
// Tell the Key class which view should receive keyboard input.
|
||||
ProjectView.focused = that;
|
||||
View.focused = that;
|
||||
if (!(tool = that._scope.tool))
|
||||
return;
|
||||
curPoint = viewToArtwork(event);
|
Loading…
Reference in a new issue