reflexion 0.1.39 → 0.1.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.doc/ext/reflex/native.cpp +2 -0
- data/.doc/ext/reflex/screen.cpp +53 -0
- data/.doc/ext/reflex/view.cpp +22 -0
- data/.doc/ext/reflex/window.cpp +70 -12
- data/ChangeLog.md +15 -0
- data/VERSION +1 -1
- data/ext/reflex/native.cpp +2 -0
- data/ext/reflex/screen.cpp +55 -0
- data/ext/reflex/view.cpp +38 -14
- data/ext/reflex/window.cpp +76 -13
- data/include/reflex/ruby/screen.h +40 -0
- data/include/reflex/screen.h +43 -0
- data/include/reflex/view.h +3 -1
- data/include/reflex/window.h +21 -3
- data/lib/reflex/contact_event.rb +1 -1
- data/lib/reflex/screen.rb +21 -0
- data/lib/reflex/view.rb +3 -2
- data/lib/reflex/window.rb +3 -1
- data/lib/reflex.rb +1 -0
- data/reflex.gemspec +11 -14
- data/src/body.cpp +14 -0
- data/src/body.h +4 -0
- data/src/osx/native_window.mm +10 -10
- data/src/osx/screen.h +21 -0
- data/src/osx/screen.mm +58 -0
- data/src/osx/window.h +4 -0
- data/src/osx/window.mm +35 -9
- data/src/view.cpp +13 -2
- data/src/window.cpp +23 -7
- data/src/window.h +6 -2
- data/test/test_event.rb +4 -0
- data/test/test_screen.rb +18 -0
- data/test/test_view.rb +20 -6
- data/test/test_window.rb +48 -6
- metadata +23 -12
data/include/reflex/window.h
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
#include <rays/painter.h>
|
12
12
|
#include <reflex/defs.h>
|
13
13
|
#include <reflex/event.h>
|
14
|
+
#include <reflex/screen.h>
|
14
15
|
|
15
16
|
|
16
17
|
namespace Reflex
|
@@ -29,12 +30,27 @@ namespace Reflex
|
|
29
30
|
|
30
31
|
typedef Xot::Ref<This> Ref;
|
31
32
|
|
33
|
+
enum Flag
|
34
|
+
{
|
35
|
+
|
36
|
+
FLAG_CLOSABLE = Xot::bit(0),
|
37
|
+
|
38
|
+
FLAG_MINIMIZABLE = Xot::bit(1),
|
39
|
+
|
40
|
+
FLAG_RESIZABLE = Xot::bit(2),
|
41
|
+
|
42
|
+
FLAG_LAST = FLAG_RESIZABLE
|
43
|
+
|
44
|
+
};// Flag
|
45
|
+
|
32
46
|
Window ();
|
33
47
|
|
34
48
|
virtual void show ();
|
35
49
|
|
36
50
|
virtual void hide ();
|
37
51
|
|
52
|
+
virtual bool hidden () const;
|
53
|
+
|
38
54
|
virtual void close (bool force = false);
|
39
55
|
|
40
56
|
virtual void redraw ();
|
@@ -53,11 +69,13 @@ namespace Reflex
|
|
53
69
|
|
54
70
|
virtual Bounds frame () const;
|
55
71
|
|
56
|
-
virtual void
|
72
|
+
virtual void add_flag (uint flags);
|
57
73
|
|
58
|
-
virtual
|
74
|
+
virtual void remove_flag (uint flags);
|
59
75
|
|
60
|
-
virtual bool
|
76
|
+
virtual bool has_flag (uint flags) const;
|
77
|
+
|
78
|
+
virtual Screen screen () const;
|
61
79
|
|
62
80
|
virtual View* root ();
|
63
81
|
|
data/lib/reflex/contact_event.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
|
4
|
+
module Reflex
|
5
|
+
|
6
|
+
|
7
|
+
class Screen
|
8
|
+
|
9
|
+
extend Forwardable
|
10
|
+
|
11
|
+
def_delegators :frame,
|
12
|
+
:x, :y, :z, :w, :h, :d, :width, :height, :depth,
|
13
|
+
:left, :top, :back, :right, :bottom, :front,
|
14
|
+
:left_top, :right_top, :left_bottom, :right_bottom,
|
15
|
+
:lt, :lr, :lb, :rb,
|
16
|
+
:position, :pos, :size, :center
|
17
|
+
|
18
|
+
end# Screen
|
19
|
+
|
20
|
+
|
21
|
+
end# Reflex
|
data/lib/reflex/view.rb
CHANGED
@@ -120,14 +120,15 @@ module Reflex
|
|
120
120
|
cache: {reader: :cache?},
|
121
121
|
resize_to_fit: {reader: :resize_to_fit?},
|
122
122
|
scroll_to_fit: {reader: :scroll_to_fit?},
|
123
|
+
fix_angle: {reader: :fix_angle?},
|
123
124
|
static: {reader: :static?},
|
124
125
|
dynamic: {reader: :dynamic?},
|
125
126
|
sensor: {reader: :sensor?},
|
126
127
|
debug: {reader: :debug?}
|
127
128
|
|
128
|
-
alias add
|
129
|
+
alias add add_child
|
129
130
|
alias remove remove_child
|
130
|
-
alias find
|
131
|
+
alias find find_child
|
131
132
|
|
132
133
|
alias apply_impulse apply_linear_impulse
|
133
134
|
alias velocity= linear_velocity=
|
data/lib/reflex/window.rb
CHANGED
@@ -62,7 +62,9 @@ module Reflex
|
|
62
62
|
:restitution=, :restitution
|
63
63
|
|
64
64
|
universal_accessor :title, :frame,
|
65
|
-
|
65
|
+
closable: {reader: :closable?},
|
66
|
+
minimizable: {reader: :minimizable?},
|
67
|
+
resizable: {reader: :resizable?}
|
66
68
|
|
67
69
|
def initialize(options = nil, &block)
|
68
70
|
super()
|
data/lib/reflex.rb
CHANGED
data/reflex.gemspec
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
# -*- mode: ruby -*-
|
2
2
|
|
3
3
|
|
4
|
-
|
5
|
-
.tap {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
|
6
|
-
|
7
|
-
require 'reflex/extension'
|
4
|
+
require_relative 'lib/reflex/extension'
|
8
5
|
|
9
6
|
|
10
7
|
Gem::Specification.new do |s|
|
@@ -17,21 +14,21 @@ Gem::Specification.new do |s|
|
|
17
14
|
rdocs = glob.call *%w[README .doc/ext/**/*.cpp]
|
18
15
|
|
19
16
|
s.name = "#{name}ion"
|
17
|
+
s.version = ext.version
|
18
|
+
s.license = 'MIT'
|
20
19
|
s.summary = 'A Graphical User Interface Tool Kit.'
|
21
20
|
s.description = 'This library helps you to develop interactive graphical user interface.'
|
22
|
-
s.
|
23
|
-
|
24
|
-
s.
|
25
|
-
s.email = 'xordog@gmail.com'
|
26
|
-
s.homepage = "https://github.com/xord/reflex"
|
21
|
+
s.authors = %w[xordog]
|
22
|
+
s.email = 'xordog@gmail.com'
|
23
|
+
s.homepage = "https://github.com/xord/reflex"
|
27
24
|
|
28
25
|
s.platform = Gem::Platform::RUBY
|
29
|
-
s.required_ruby_version = '>=
|
26
|
+
s.required_ruby_version = '>= 3.0.0'
|
30
27
|
|
31
|
-
s.add_runtime_dependency 'xot', '~> 0.1.
|
32
|
-
s.add_runtime_dependency 'rucy', '~> 0.1.
|
33
|
-
s.add_runtime_dependency 'beeps', '~> 0.1.
|
34
|
-
s.add_runtime_dependency 'rays', '~> 0.1.
|
28
|
+
s.add_runtime_dependency 'xot', '~> 0.1.38'
|
29
|
+
s.add_runtime_dependency 'rucy', '~> 0.1.38'
|
30
|
+
s.add_runtime_dependency 'beeps', '~> 0.1.39'
|
31
|
+
s.add_runtime_dependency 'rays', '~> 0.1.39'
|
35
32
|
|
36
33
|
s.add_development_dependency 'rake'
|
37
34
|
s.add_development_dependency 'test-unit'
|
data/src/body.cpp
CHANGED
@@ -247,6 +247,20 @@ namespace Reflex
|
|
247
247
|
return Xot::rad2deg(self->b2body->GetAngularVelocity());
|
248
248
|
}
|
249
249
|
|
250
|
+
void
|
251
|
+
Body::fix_rotation (bool state)
|
252
|
+
{
|
253
|
+
validate(this);
|
254
|
+
|
255
|
+
self->b2body->SetFixedRotation(state);
|
256
|
+
}
|
257
|
+
|
258
|
+
bool
|
259
|
+
Body::is_rotation_fixed () const
|
260
|
+
{
|
261
|
+
return self->b2body->IsFixedRotation();
|
262
|
+
}
|
263
|
+
|
250
264
|
void
|
251
265
|
Body::set_gravity_scale (float scale)
|
252
266
|
{
|
data/src/body.h
CHANGED
data/src/osx/native_window.mm
CHANGED
@@ -12,13 +12,13 @@
|
|
12
12
|
#import "opengl_view.h"
|
13
13
|
|
14
14
|
|
15
|
-
static
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
static NSWindowStyleMask
|
16
|
+
default_style_mask ()
|
17
|
+
{
|
18
|
+
return Window_make_style_mask(
|
19
|
+
Reflex::Window::Data::FLAG_DEFAULT,
|
20
|
+
NSTitledWindowMask | NSTexturedBackgroundWindowMask);
|
21
|
+
}
|
22
22
|
|
23
23
|
static int
|
24
24
|
count_mouse_buttons (const Reflex::PointerEvent& e)
|
@@ -67,7 +67,7 @@ update_pixel_density (Reflex::Window* window)
|
|
67
67
|
{
|
68
68
|
self = [super
|
69
69
|
initWithContentRect: NSMakeRect(0, 0, 0, 0)
|
70
|
-
styleMask:
|
70
|
+
styleMask: default_style_mask()
|
71
71
|
backing: NSBackingStoreBuffered
|
72
72
|
defer: NO];
|
73
73
|
if (!self) return nil;
|
@@ -368,7 +368,7 @@ update_pixel_density (Reflex::Window* window)
|
|
368
368
|
if (clicking_count == 0)
|
369
369
|
++pointer_id;
|
370
370
|
else if (clicking_count < 0)
|
371
|
-
Reflex::invalid_state_error(__FILE__, __LINE__);
|
371
|
+
return;//Reflex::invalid_state_error(__FILE__, __LINE__);
|
372
372
|
|
373
373
|
Window_call_pointer_event(win, &e);
|
374
374
|
}
|
@@ -420,7 +420,7 @@ update_pixel_density (Reflex::Window* window)
|
|
420
420
|
{
|
421
421
|
return [NSWindow
|
422
422
|
frameRectForContentRect: contentRect
|
423
|
-
styleMask:
|
423
|
+
styleMask: default_style_mask()];
|
424
424
|
}
|
425
425
|
|
426
426
|
@end// NativeWindow
|
data/src/osx/screen.h
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
// -*- c++ -*-
|
2
|
+
#pragma once
|
3
|
+
#ifndef __REFLEX_SRC_OSX_SCREEN_H__
|
4
|
+
#define __REFLEX_SRC_OSX_SCREEN_H__
|
5
|
+
|
6
|
+
|
7
|
+
#import <AppKit/NSScreen.h>
|
8
|
+
#include "reflex/screen.h"
|
9
|
+
|
10
|
+
|
11
|
+
namespace Reflex
|
12
|
+
{
|
13
|
+
|
14
|
+
|
15
|
+
void Screen_initialize (Screen* pthis, NSScreen* screen);
|
16
|
+
|
17
|
+
|
18
|
+
}// Reflex
|
19
|
+
|
20
|
+
|
21
|
+
#endif//EOH
|
data/src/osx/screen.mm
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
// -*- mode: objc -*-
|
2
|
+
#include "screen.h"
|
3
|
+
|
4
|
+
|
5
|
+
namespace Reflex
|
6
|
+
{
|
7
|
+
|
8
|
+
|
9
|
+
struct Screen::Data
|
10
|
+
{
|
11
|
+
|
12
|
+
NSScreen* screen = nil;
|
13
|
+
|
14
|
+
~Data ()
|
15
|
+
{
|
16
|
+
if (screen) [screen release];
|
17
|
+
}
|
18
|
+
|
19
|
+
};// Screen::Data
|
20
|
+
|
21
|
+
|
22
|
+
void
|
23
|
+
Screen_initialize (Screen* pthis, NSScreen* screen)
|
24
|
+
{
|
25
|
+
pthis->self->screen = [screen retain];
|
26
|
+
}
|
27
|
+
|
28
|
+
|
29
|
+
Screen::Screen ()
|
30
|
+
{
|
31
|
+
}
|
32
|
+
|
33
|
+
Screen::~Screen ()
|
34
|
+
{
|
35
|
+
}
|
36
|
+
|
37
|
+
Bounds
|
38
|
+
Screen::frame () const
|
39
|
+
{
|
40
|
+
NSRect frame = self->screen.frame;
|
41
|
+
return Bounds(
|
42
|
+
frame.origin.x, frame.origin.y,
|
43
|
+
frame.size.width, frame.size.height);
|
44
|
+
}
|
45
|
+
|
46
|
+
Screen::operator bool () const
|
47
|
+
{
|
48
|
+
return self->screen;
|
49
|
+
}
|
50
|
+
|
51
|
+
bool
|
52
|
+
Screen::operator ! () const
|
53
|
+
{
|
54
|
+
return !operator bool();
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
}// Reflex
|
data/src/osx/window.h
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
#define __REFLEX_SRC_OSX_WINDOW_H__
|
5
5
|
|
6
6
|
|
7
|
+
#import <AppKit/NSWindow.h>
|
7
8
|
#include "../window.h"
|
8
9
|
|
9
10
|
|
@@ -35,6 +36,9 @@ namespace Reflex
|
|
35
36
|
|
36
37
|
const WindowData& Window_get_data (const Window* window);
|
37
38
|
|
39
|
+
NSWindowStyleMask Window_make_style_mask (
|
40
|
+
uint flags, NSWindowStyleMask styleMask = 0);
|
41
|
+
|
38
42
|
|
39
43
|
}// Reflex
|
40
44
|
|
data/src/osx/window.mm
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
#import <Cocoa/Cocoa.h>
|
6
6
|
#include "reflex/exception.h"
|
7
|
+
#include "screen.h"
|
7
8
|
#import "native_window.h"
|
8
9
|
|
9
10
|
|
@@ -31,6 +32,27 @@ namespace Reflex
|
|
31
32
|
return Window_get_data(const_cast<Window*>(window));
|
32
33
|
}
|
33
34
|
|
35
|
+
NSWindowStyleMask
|
36
|
+
Window_make_style_mask (uint flags, NSWindowStyleMask styleMask)
|
37
|
+
{
|
38
|
+
if (Xot::has_flag(flags, Window::FLAG_CLOSABLE))
|
39
|
+
styleMask |= NSWindowStyleMaskClosable;
|
40
|
+
else
|
41
|
+
styleMask &= ~NSWindowStyleMaskClosable;
|
42
|
+
|
43
|
+
if (Xot::has_flag(flags, Window::FLAG_MINIMIZABLE))
|
44
|
+
styleMask |= NSWindowStyleMaskMiniaturizable;
|
45
|
+
else
|
46
|
+
styleMask &= ~NSWindowStyleMaskMiniaturizable;
|
47
|
+
|
48
|
+
if (Xot::has_flag(flags, Window::FLAG_RESIZABLE))
|
49
|
+
styleMask |= NSWindowStyleMaskResizable;
|
50
|
+
else
|
51
|
+
styleMask &= ~NSWindowStyleMaskResizable;
|
52
|
+
|
53
|
+
return styleMask;
|
54
|
+
}
|
55
|
+
|
34
56
|
static NativeWindow*
|
35
57
|
get_native (const Window* window)
|
36
58
|
{
|
@@ -113,19 +135,23 @@ namespace Reflex
|
|
113
135
|
}
|
114
136
|
|
115
137
|
void
|
116
|
-
|
138
|
+
Window_set_flags (Window* window, uint flags)
|
117
139
|
{
|
118
|
-
NativeWindow* native
|
119
|
-
|
120
|
-
native.styleMask
|
121
|
-
|
122
|
-
|
140
|
+
NativeWindow* native = get_native(window);
|
141
|
+
NSWindowStyleMask styleMask =
|
142
|
+
Window_make_style_mask(window->self->flags, native.styleMask);
|
143
|
+
|
144
|
+
if (styleMask != native.styleMask)
|
145
|
+
native.styleMask = styleMask;
|
123
146
|
}
|
124
147
|
|
125
|
-
|
126
|
-
|
148
|
+
Screen
|
149
|
+
Window_get_screen (const Window& window)
|
127
150
|
{
|
128
|
-
|
151
|
+
Screen s;
|
152
|
+
NativeWindow* native = get_native(&window);
|
153
|
+
if (native && native.screen) Screen_initialize(&s, native.screen);
|
154
|
+
return s;
|
129
155
|
}
|
130
156
|
|
131
157
|
float
|
data/src/view.cpp
CHANGED
@@ -216,6 +216,7 @@ namespace Reflex
|
|
216
216
|
|
217
217
|
pbody.reset(b);
|
218
218
|
update_body_frame();
|
219
|
+
update_body_states();
|
219
220
|
}
|
220
221
|
return *pbody;
|
221
222
|
}
|
@@ -235,6 +236,12 @@ namespace Reflex
|
|
235
236
|
pbody->set_transform(frame.x, frame.y, angle);
|
236
237
|
}
|
237
238
|
|
239
|
+
void update_body_states ()
|
240
|
+
{
|
241
|
+
if (pbody && pbody->is_rotation_fixed() != has_flag(View::FLAG_FIX_ANGLE))
|
242
|
+
pbody->fix_rotation(has_flag(View::FLAG_FIX_ANGLE));
|
243
|
+
}
|
244
|
+
|
238
245
|
void
|
239
246
|
get_view2body_matrix (Matrix* m)
|
240
247
|
{
|
@@ -261,7 +268,7 @@ namespace Reflex
|
|
261
268
|
.translate(-pivot);
|
262
269
|
}
|
263
270
|
|
264
|
-
void
|
271
|
+
void setup_body_and_shapes ()
|
265
272
|
{
|
266
273
|
std::unique_ptr<Body> old_body;
|
267
274
|
if (pbody)
|
@@ -718,7 +725,7 @@ namespace Reflex
|
|
718
725
|
}
|
719
726
|
|
720
727
|
view->self->window = window;
|
721
|
-
view->self->
|
728
|
+
view->self->setup_body_and_shapes();
|
722
729
|
|
723
730
|
View::ChildList* children = view->self->children();
|
724
731
|
if (children)
|
@@ -2364,12 +2371,16 @@ namespace Reflex
|
|
2364
2371
|
View::add_flag (uint flags)
|
2365
2372
|
{
|
2366
2373
|
self->add_flag(flags);
|
2374
|
+
|
2375
|
+
self->update_body_states();
|
2367
2376
|
}
|
2368
2377
|
|
2369
2378
|
void
|
2370
2379
|
View::remove_flag (uint flags)
|
2371
2380
|
{
|
2372
2381
|
self->remove_flag(flags);
|
2382
|
+
|
2383
|
+
self->update_body_states();
|
2373
2384
|
}
|
2374
2385
|
|
2375
2386
|
bool
|
data/src/window.cpp
CHANGED
@@ -450,6 +450,12 @@ namespace Reflex
|
|
450
450
|
self->hide_count = new_count;
|
451
451
|
}
|
452
452
|
|
453
|
+
bool
|
454
|
+
Window::hidden () const
|
455
|
+
{
|
456
|
+
return self->hide_count > 0;
|
457
|
+
}
|
458
|
+
|
453
459
|
void
|
454
460
|
Window::close (bool force)
|
455
461
|
{
|
@@ -512,21 +518,31 @@ namespace Reflex
|
|
512
518
|
}
|
513
519
|
|
514
520
|
void
|
515
|
-
Window::
|
521
|
+
Window::add_flag (uint flags)
|
516
522
|
{
|
517
|
-
|
523
|
+
Xot::add_flag(&self->flags, flags);
|
524
|
+
|
525
|
+
Window_set_flags(this, self->flags);
|
518
526
|
}
|
519
527
|
|
520
|
-
|
521
|
-
Window::
|
528
|
+
void
|
529
|
+
Window::remove_flag (uint flags)
|
522
530
|
{
|
523
|
-
|
531
|
+
Xot::remove_flag(&self->flags, flags);
|
532
|
+
|
533
|
+
Window_set_flags(this, self->flags);
|
524
534
|
}
|
525
535
|
|
526
536
|
bool
|
527
|
-
Window::
|
537
|
+
Window::has_flag (uint flags) const
|
528
538
|
{
|
529
|
-
return self->
|
539
|
+
return Xot::has_flag(self->flags, flags);
|
540
|
+
}
|
541
|
+
|
542
|
+
Screen
|
543
|
+
Window::screen () const
|
544
|
+
{
|
545
|
+
return Window_get_screen(*this);
|
530
546
|
}
|
531
547
|
|
532
548
|
View*
|
data/src/window.h
CHANGED
@@ -37,6 +37,8 @@ namespace Reflex
|
|
37
37
|
|
38
38
|
typedef std::map<View::Ref, TargetPointerMap> CaptureMap;
|
39
39
|
|
40
|
+
enum {FLAG_DEFAULT = FLAG_CLOSABLE | FLAG_MINIMIZABLE | FLAG_RESIZABLE};
|
41
|
+
|
40
42
|
int hide_count = 1;
|
41
43
|
|
42
44
|
bool redraw = true;
|
@@ -51,6 +53,8 @@ namespace Reflex
|
|
51
53
|
|
52
54
|
CaptureMap captures;
|
53
55
|
|
56
|
+
uint flags = FLAG_DEFAULT;
|
57
|
+
|
54
58
|
Data ()
|
55
59
|
{
|
56
60
|
prev_time_update = prev_time_draw = Xot::time();
|
@@ -94,9 +98,9 @@ namespace Reflex
|
|
94
98
|
|
95
99
|
Bounds Window_get_frame (const Window& window);
|
96
100
|
|
97
|
-
|
101
|
+
Screen Window_get_screen (const Window& window);
|
98
102
|
|
99
|
-
|
103
|
+
void Window_set_flags (Window* window, uint flags);
|
100
104
|
|
101
105
|
void Window_set_focus (Window* window, View* view);
|
102
106
|
|
data/test/test_event.rb
CHANGED
data/test/test_screen.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative 'helper'
|
2
|
+
|
3
|
+
|
4
|
+
class TestScreen < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def screen()
|
7
|
+
Reflex::Window.new.screen
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_initialize()
|
11
|
+
assert_raise(Reflex::ReflexError) {Reflex::Screen.new}
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_frame()
|
15
|
+
assert_raise(Rucy::InvalidObjectError) {screen.frame}
|
16
|
+
end
|
17
|
+
|
18
|
+
end# TestScreen
|
data/test/test_view.rb
CHANGED
@@ -28,21 +28,21 @@ class TestView < Test::Unit::TestCase
|
|
28
28
|
|
29
29
|
def test_show_hide_hidden()
|
30
30
|
v = view
|
31
|
-
|
31
|
+
assert_false v.hidden?
|
32
32
|
v.hide
|
33
|
-
|
33
|
+
assert_true v.hidden?
|
34
34
|
v.show
|
35
|
-
|
35
|
+
assert_false v.hidden?
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_hidden_count()
|
39
39
|
v = view
|
40
40
|
v.show
|
41
|
-
|
41
|
+
assert_false v.hidden?
|
42
42
|
v.hide
|
43
|
-
|
43
|
+
assert_false v.hidden?
|
44
44
|
v.hide
|
45
|
-
|
45
|
+
assert_true v.hidden?
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_coord_conversion()
|
@@ -275,6 +275,20 @@ class TestView < Test::Unit::TestCase
|
|
275
275
|
assert_equal 361, v.angle
|
276
276
|
end
|
277
277
|
|
278
|
+
def test_fix_angle()
|
279
|
+
v = view
|
280
|
+
assert_false v.fix_angle?
|
281
|
+
assert_false v.fix_angle
|
282
|
+
|
283
|
+
v.fix_angle = true
|
284
|
+
assert_true v.fix_angle?
|
285
|
+
assert_true v.fix_angle
|
286
|
+
|
287
|
+
v.fix_angle false
|
288
|
+
assert_false v.fix_angle?
|
289
|
+
assert_false v.fix_angle
|
290
|
+
end
|
291
|
+
|
278
292
|
def test_pivot()
|
279
293
|
v = view
|
280
294
|
assert_each_in_epsilon [0, 0, 0], v.pivot.to_a(3)
|