Renaming to VerticalMirrorPen

This commit is contained in:
Vince 2012-09-16 00:52:39 +02:00
parent 1a143ad5e3
commit b761750766
3 changed files with 9 additions and 9 deletions

View File

@ -113,7 +113,7 @@
<!-- Tools-->
<script src="js/drawingtools/BaseTool.js"></script>
<script src="js/drawingtools/SimplePen.js"></script>
<script src="js/drawingtools/MirrorPen.js"></script>
<script src="js/drawingtools/VerticalMirrorPen.js"></script>
<script src="js/drawingtools/Eraser.js"></script>
<script src="js/drawingtools/Stroke.js"></script>
<script src="js/drawingtools/PaintBucket.js"></script>

View File

@ -6,7 +6,7 @@
this.toolInstances = {
"simplePen" : new pskl.drawingtools.SimplePen(),
"mirrorPen" : new pskl.drawingtools.MirrorPen(),
"verticalMirrorPen" : new pskl.drawingtools.VerticalMirrorPen(),
"eraser" : new pskl.drawingtools.Eraser(),
"paintBucket" : new pskl.drawingtools.PaintBucket(),
"stroke" : new pskl.drawingtools.Stroke(),

View File

@ -1,24 +1,24 @@
(function() {
var ns = $.namespace("pskl.drawingtools");
ns.MirrorPen = function() {
ns.VerticalMirrorPen = function() {
this.toolId = "tool-vertical-mirror-pen";
this.helpText = "Mirror pen tool";
this.helpText = "vertical mirror pen tool";
this.swap = null
this.mirroredPreviousCol = null;
this.mirroredPreviousRow = null;
};
pskl.utils.inherit(ns.MirrorPen, ns.SimplePen);
pskl.utils.inherit(ns.VerticalMirrorPen, ns.SimplePen);
ns.MirrorPen.prototype.setMirrorContext = function() {
ns.VerticalMirrorPen.prototype.setMirrorContext = function() {
this.swap = this.previousCol;
this.previousCol = this.mirroredPreviousCol;
};
ns.MirrorPen.prototype.unsetMirrorContext = function() {
ns.VerticalMirrorPen.prototype.unsetMirrorContext = function() {
this.mirroredPreviousCol = this.previousCol;
this.previousCol = this.swap;
};
@ -26,7 +26,7 @@
/**
* @override
*/
ns.MirrorPen.prototype.applyToolAt = function(col, row, color, frame, overlay) {
ns.VerticalMirrorPen.prototype.applyToolAt = function(col, row, color, frame, overlay) {
this.superclass.applyToolAt.call(this, col, row, color, frame, overlay);
var mirroredCol = this.getSymmetricCol_(col, frame);
@ -40,7 +40,7 @@
/**
* @private
*/
ns.MirrorPen.prototype.getSymmetricCol_ = function(col, frame) {
ns.VerticalMirrorPen.prototype.getSymmetricCol_ = function(col, frame) {
return frame.getWidth() - col - 1;
};
})();