Skip to content

Commit

Permalink
Fixed unused values
Browse files Browse the repository at this point in the history
  • Loading branch information
bp74 committed Dec 3, 2014
1 parent ef6d90b commit 7c35e2d
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 49 deletions.
12 changes: 6 additions & 6 deletions lib/src/display/stage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ part of stagexl.display;
class StageScaleMode {

final int _ordinal;
const StageScaleMode._(this._ordinal);
final int index;
const StageScaleMode._(this.index);

static const StageScaleMode EXACT_FIT = const StageScaleMode._(0);
static const StageScaleMode NO_BORDER = const StageScaleMode._(1);
Expand All @@ -19,8 +19,8 @@ class StageScaleMode {
class StageAlign {

final int _ordinal;
const StageAlign._(this._ordinal);
final int index;
const StageAlign._(this.index);

static const StageAlign BOTTOM = const StageAlign._(0);
static const StageAlign BOTTOM_LEFT = const StageAlign._(1);
Expand All @@ -38,8 +38,8 @@ class StageAlign {
class StageRenderMode {

final int _ordinal;
const StageRenderMode._(this._ordinal);
final int index;
const StageRenderMode._(this.index);

static const StageRenderMode AUTO = const StageRenderMode._(0);
static const StageRenderMode STOP = const StageRenderMode._(1);
Expand Down
1 change: 0 additions & 1 deletion lib/src/display_ex/time_gauge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class TimeGauge extends Gauge implements Animatable {
static const String TIME_SHORT = 'TIME_SHORT';

bool _isStarted = false;
num _currentTime = 0.0;
num _totalTime = 0.0;

Map<String, num> _alarms;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/drawing/graphics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ class Graphics {
}

//----------------------------------------------------------------------------

/*
void _drawPath(CanvasRenderingContext2D context) {
for(int i = 0; i < _commands.length; i++) {
_commands[i].drawPath(context);
}
}

*/

}
2 changes: 1 addition & 1 deletion lib/src/engine/render_texture.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class RenderTexture {

CanvasImageSource _source;
CanvasElement _canvas;
VideoElement _video;
RenderTextureQuad _quad;
RenderTextureFiltering _filtering = RenderTextureFiltering.LINEAR;

Expand Down Expand Up @@ -124,6 +123,7 @@ class RenderTexture {

int get width => _width;
int get height => _height;
bool get transparent => _transparent;

int get storeWidth => _storeWidth;
int get storeHeight => _storeHeight;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/events/event_phase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ part of stagexl.events;
/// Provides constant values for the eventPhase property of the [Event] class.
class EventPhase {

final int _ordinal;
const EventPhase._(this._ordinal);
final int index;
const EventPhase._(this.index);

static const EventPhase CAPTURING_PHASE = const EventPhase._(0);
static const EventPhase AT_TARGET = const EventPhase._(1);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/events/key_location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ part of stagexl.events;
/// [KeyboardEvent.getKeyLocation].
class KeyLocation {

final int _ordinal;
const KeyLocation._(this._ordinal);
final int index;
const KeyLocation._(this.index);

/// The event key is not distinguished as the left or right version
/// of the key, and did not originate from the numeric keypad (or did not
Expand Down
12 changes: 4 additions & 8 deletions lib/src/toolkit/timeline_tween.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ part of stagexl.toolkit;
// ToDo: possibly add a END actionsMode (only runs actions that == position)?
// ToDo: evaluate a way to decouple paused from tick registration.

/// **Note:** This class is not intended to be used directly. It is needed by
/// **Note:** This class is not intended to be used directly. It is needed by
/// the 'Toolkit for Dart' to export from Flash Professional to Dart/StageXL.
///
/// A TimelineTween instance tweens properties for a single target.
Expand Down Expand Up @@ -412,7 +412,7 @@ class TimelineTween {
return end;
}

var prevPos = _prevPos;
//var prevPos = _prevPos;
position = _prevPos = t; // set this in advance in case an action modifies position.
_prevPosition = value;

Expand Down Expand Up @@ -491,7 +491,7 @@ class TimelineTween {
* @protected
**/
void _updateTargetProps(TimelineStep step, num ratio) {
var p0, p1, v, v0, v1, arr;
var p0, p1, v, v0, v1;
num dv, dv0, dv1;
if (step == null && ratio == 1) {
p0 = p1 = _curQueueProps;
Expand Down Expand Up @@ -612,11 +612,7 @@ class TimelineTween {
* @protected
**/
Map<String, dynamic> _appendQueueProps(Map<String, dynamic> o) {
var arr,
oldValue = null,
i,
l,
injectProps;
var oldValue = null;
for (var n in o.keys) {
if (!_initQueueProps.containsKey(n)) {

Expand Down
47 changes: 23 additions & 24 deletions lib/src/ui/multitouch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ class MultitouchInputMode {
final String name;
const MultitouchInputMode(this.name);

/// Specifies that gesture events are dispatched for the related user
/// interaction supported by the current environment, and other touch events
/// Specifies that gesture events are dispatched for the related user
/// interaction supported by the current environment, and other touch events
/// (such as a simple tap) are interpreted as mouse events.
static const MultitouchInputMode GESTURE = const MultitouchInputMode("GESTURE");

/// Specifies that all user contact with a touch-enabled device is interpreted
/// as a type of mouse event.
static const MultitouchInputMode NONE = const MultitouchInputMode("NONE");
/// Specifies that events are dispatched only for basic touch events, such as
/// a single finger tap. When you use this setting, events listed in the

/// Specifies that events are dispatched only for basic touch events, such as
/// a single finger tap. When you use this setting, events listed in the
/// [TouchEvent] class are dispatched; events listed in the gesture event
/// classes are not dispatched.
static const MultitouchInputMode TOUCH_POINT = const MultitouchInputMode("TOUCH_POINT");
}

/// The [Multitouch] class is used opt-in for multi touch support in your
/// application.
///
/// It also provides an easy way to check if the current device supports multi
/// application.
///
/// It also provides an easy way to check if the current device supports multi
/// touch or not.
///
/// Example:
Expand All @@ -41,26 +41,25 @@ class MultitouchInputMode {
/// sprite.onTouchBegin.listen(_onTouchBegin);
class Multitouch {

/// Indicates whether the current environment supports gesture input, such as
/// rotating two fingers around a touch screen.
///
/// Indicates whether the current environment supports gesture input, such as
/// rotating two fingers around a touch screen.
///
/// Note: This always returns false because gestures are not implementet yet.
/// TODO: Implement gesture support.
static bool supportsGestureEvents = false;
/// Indicates whether the current environment supports basic touch input.

/// Indicates whether the current environment supports basic touch input.
/// Touch events are listed in the [TouchEvent] class.
static bool supportsTouchEvents = _checkTouchEvents();
/// A list of multi-touch contact types supported in the current environment.
/// The list of Strings can be used as event types to register event
/// listeners.
///

/// A list of multi-touch contact types supported in the current environment.
/// The list of Strings can be used as event types to register event
/// listeners.
///
/// Note: The list is currently empty because gestures are not implemented yet.
/// TODO: Implement gesture support.
static List<String> supportedGestures = [];

static bool _initialized = false;
static MultitouchInputMode _inputMode = MultitouchInputMode.NONE;

static final _inputModeChangedEvent = new StreamController<MultitouchInputMode>.broadcast();
Expand All @@ -70,12 +69,12 @@ class Multitouch {

static int get maxTouchPoints => supportsTouchEvents ? 10 : 0;

/// Returns the multi-touch mode for touch and gesture event handling.
/// Returns the multi-touch mode for touch and gesture event handling.
static MultitouchInputMode get inputMode => _inputMode;

/// Sets the multi-touch mode for touch and gesture event handling. Use
/// this property to manage whether or not events are dispatched as touch
/// events with multiple points of contact and specific events for different
/// Sets the multi-touch mode for touch and gesture event handling. Use
/// this property to manage whether or not events are dispatched as touch
/// events with multiple points of contact and specific events for different
/// gestures.
static set inputMode(MultitouchInputMode value) {
_inputMode = value;
Expand Down
8 changes: 5 additions & 3 deletions test/events/events_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ void main() {

var sub1 = dispatcher.on(eventType).listen(listener1);
var sub2 = dispatcher.on(eventType).listen(listener2);
var sub3 = dispatcher.on(eventType).listen((Event event) => actual.add(
"listener3"));
var sub3 = dispatcher.on(eventType).listen((Event event) => actual.add("listener3"));

sub2.cancel();

dispatcher.dispatchEvent(new Event(eventType));

expect(sub1.isCanceled, equals(false));
expect(sub2.isCanceled, equals(true));
expect(sub3.isCanceled, equals(false));
expect(actual, equals(expected));
});

Expand Down

0 comments on commit 7c35e2d

Please sign in to comment.