summaryrefslogtreecommitdiff
path: root/inputmethods/dasher/DasherView.cpp
Unidiff
Diffstat (limited to 'inputmethods/dasher/DasherView.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dasher/DasherView.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/inputmethods/dasher/DasherView.cpp b/inputmethods/dasher/DasherView.cpp
index 3b8cb64..8e32cf1 100644
--- a/inputmethods/dasher/DasherView.cpp
+++ b/inputmethods/dasher/DasherView.cpp
@@ -1,82 +1,82 @@
1// DasherView.cpp 1// DasherView.cpp
2// 2//
3///////////////////////////////////////////////////////////////////////////// 3/////////////////////////////////////////////////////////////////////////////
4// 4//
5// Copyright (c) 2001-2002 David Ward 5// Copyright (c) 2001-2002 David Ward
6// 6//
7///////////////////////////////////////////////////////////////////////////// 7/////////////////////////////////////////////////////////////////////////////
8 8
9#include "DasherView.h" 9#include "DasherView.h"
10using namespace Dasher; 10using namespace Dasher;
11 11
12 12
13CDasherView::CDasherView(CDasherScreen* DasherScreen, CDasherModel& DasherModel, Opts::ScreenOrientations Orientation) 13CDasherView::CDasherView(CDasherScreen* DasherScreen, CDasherModel& DasherModel, Opts::ScreenOrientations Orientation)
14 : m_Screen(DasherScreen), m_DasherModel(DasherModel), ScreenOrientation(Orientation), ColourMode(false) 14 : m_Screen(DasherScreen), m_DasherModel(DasherModel), ScreenOrientation(Orientation), ColourMode(false)
15{ 15{
16 //XYScale = (double)m_Screen->GetHeight() / m_Screen->GetWidth(); 16 //XYScale = (double)m_Screen->GetHeight() / m_Screen->GetWidth();
17} 17}
18 18
19 19
20void CDasherView::ChangeOrientation(Dasher::Opts::ScreenOrientations Orientation) 20void CDasherView::ChangeOrientation(Dasher::Opts::ScreenOrientations Orientation)
21{ 21{
22 ScreenOrientation = Orientation; 22 ScreenOrientation = Orientation;
23 Render(); 23 Render();
24} 24}
25 25
26 26
27void CDasherView::FlushAt(int mousex,int mousey) 27void CDasherView::FlushAt(int ,int )
28{ 28{
29 m_DasherModel.Flush(0,0); 29 m_DasherModel.Flush(0,0);
30} 30}
31 31
32int CDasherView::RecursiveRender(CDasherNode* Render, myint y1,myint y2,int mostleft, bool text) 32int CDasherView::RecursiveRender(CDasherNode* Render, myint y1,myint y2,int mostleft, bool text)
33{ 33{
34 symbol CurChar = Render->Symbol(); 34 // symbol CurChar = Render->Symbol();
35 int Color; 35 int Color;
36 36
37 if (ColourMode==true) { 37 if (ColourMode==true) {
38 Color = Render->Colour(); 38 Color = Render->Colour();
39 } else { 39 } else {
40 Color = Render->Phase()%3; 40 Color = Render->Phase()%3;
41 } 41 }
42 42
43 if (RenderNode(Render->Symbol(), Color, Render->Cscheme(), y1, y2, mostleft, Render->m_bForce, text)) 43 if (RenderNode(Render->Symbol(), Color, Render->Cscheme(), y1, y2, mostleft, Render->m_bForce, text))
44 RenderGroups(Render, y1, y2, text); 44 RenderGroups(Render, y1, y2, text);
45 else 45 else
46 Render->Kill(); 46 Render->Kill();
47 47
48 CDasherNode** const Children=Render->Children(); 48 CDasherNode** const Children=Render->Children();
49 if (!Children) 49 if (!Children)
50 return 0; 50 return 0;
51 int norm=DasherModel().Normalization(); 51 int norm=DasherModel().Normalization();
52 for (unsigned int i=1; i<Render->Chars(); i++) { 52 for (unsigned int i=1; i<Render->Chars(); i++) {
53 if (Children[i]->Alive()) { 53 if (Children[i]->Alive()) {
54 myint Range=y2-y1; 54 myint Range=y2-y1;
55 myint newy1=y1+(Range*Children[i]->Lbnd())/norm; 55 myint newy1=y1+(Range*Children[i]->Lbnd())/norm;
56 myint newy2=y1+(Range*Children[i]->Hbnd())/norm; 56 myint newy2=y1+(Range*Children[i]->Hbnd())/norm;
57 RecursiveRender(Children[i], newy1, newy2, mostleft, text); 57 RecursiveRender(Children[i], newy1, newy2, mostleft, text);
58 } 58 }
59 } 59 }
60 return 1; 60 return 1;
61 61
62 62
63} 63}
64 64
65 65
66void CDasherView::RenderGroups(CDasherNode* Render, myint y1, myint y2, bool text) 66void CDasherView::RenderGroups(CDasherNode* Render, myint y1, myint y2, bool text)
67{ 67{
68 CDasherNode** Children = Render->Children(); 68 CDasherNode** Children = Render->Children();
69 if (!Children) 69 if (!Children)
70 return; 70 return;
71 int current=0; 71 int current=0;
72 int lower=0; 72 int lower=0;
73 int upper=0; 73 int upper=0;
74 myint range=y2-y1; 74 myint range=y2-y1;
75 for (unsigned int i=1; i<Render->Chars(); i++) { 75 for (unsigned int i=1; i<Render->Chars(); i++) {
76 int g=Children[i]->Group(); 76 int g=Children[i]->Group();
77 if (g!=current) { 77 if (g!=current) {
78 lower=upper; 78 lower=upper;
79 upper=i; 79 upper=i;
80 80
81 if (current!=0) { 81 if (current!=0) {
82 myint lbnd=Children[lower]->Lbnd(); 82 myint lbnd=Children[lower]->Lbnd();