Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
6abd9fdb
Commit
6abd9fdb
authored
8 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
f1746313
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/mobile/drawContext.cpp
+18
-18
18 additions, 18 deletions
contrib/mobile/drawContext.cpp
with
18 additions
and
18 deletions
contrib/mobile/drawContext.cpp
+
18
−
18
View file @
6abd9fdb
...
@@ -707,13 +707,13 @@ int drawContext::drawTics(drawContext *ctx, int comp, double n, std::string &for
...
@@ -707,13 +707,13 @@ int drawContext::drawTics(drawContext *ctx, int comp, double n, std::string &for
char
tmp
[
256
];
char
tmp
[
256
];
// reduce number of vertical tics if not zoomed enough
// reduce number of vertical tics if not zoomed enough
double
ww
=
_width
/
(
_right
-
_left
)
*
_scale
[
0
];
double
ww
=
_width
/
(
_right
-
_left
)
*
_scale
[
0
];
double
hh
=
_height
/
(
_top
-
_bottom
)
*
_scale
[
0
];
double
hh
=
_height
/
(
_top
-
_bottom
)
*
_scale
[
0
];
if
(
hh
<
10
&&
comp
==
1
){
if
(
hh
<
10
&&
comp
==
1
){
n
=
2
;
n
=
2
;
}
}
// draw n tics
// draw n tics
double
step
=
l
/
(
double
)(
n
-
1
);
double
step
=
l
/
(
double
)(
n
-
1
);
double
value_step
=
value_l
/
(
double
)(
n
-
1
);
double
value_step
=
value_l
/
(
double
)(
n
-
1
);
...
@@ -729,6 +729,17 @@ int drawContext::drawTics(drawContext *ctx, int comp, double n, std::string &for
...
@@ -729,6 +729,17 @@ int drawContext::drawTics(drawContext *ctx, int comp, double n, std::string &for
value_p1
[
1
]
+
value_t
[
1
]
*
value_d
,
value_p1
[
1
]
+
value_t
[
1
]
*
value_d
,
value_p1
[
2
]
+
value_t
[
2
]
*
value_d
};
value_p1
[
2
]
+
value_t
[
2
]
*
value_d
};
// draw tic labels
if
(
comp
<
0
)
// display the length value (ruler-mode, starting at 0)
sprintf
(
tmp
,
format
.
c_str
(),
value_d
);
else
// display the coordinate value
sprintf
(
tmp
,
format
.
c_str
(),
value_p
[
comp
]);
if
(
strlen
(
tmp
)){
drawString
lbl
(
tmp
,
15
*
_fontFactor
);
lbl
.
draw
(
r
[
0
],
r
[
1
],
r
[
2
],
ww
,
hh
);
}
GLfloat
lines
[]
=
{
GLfloat
lines
[]
=
{
(
float
)
p
[
0
],
(
float
)
p
[
1
],
(
float
)
p
[
2
],
(
float
)
p
[
0
],
(
float
)
p
[
1
],
(
float
)
p
[
2
],
(
float
)
q
[
0
],
(
float
)
q
[
1
],
(
float
)
q
[
2
]
(
float
)
q
[
0
],
(
float
)
q
[
1
],
(
float
)
q
[
2
]
...
@@ -744,17 +755,6 @@ int drawContext::drawTics(drawContext *ctx, int comp, double n, std::string &for
...
@@ -744,17 +755,6 @@ int drawContext::drawTics(drawContext *ctx, int comp, double n, std::string &for
glDrawArrays
(
GL_LINES
,
0
,
2
);
glDrawArrays
(
GL_LINES
,
0
,
2
);
glDisableClientState
(
GL_VERTEX_ARRAY
);
glDisableClientState
(
GL_VERTEX_ARRAY
);
glDisableClientState
(
GL_COLOR_ARRAY
);
glDisableClientState
(
GL_COLOR_ARRAY
);
// draw tic labels
if
(
comp
<
0
)
// display the length value (ruler-mode, starting at 0)
sprintf
(
tmp
,
format
.
c_str
(),
value_d
);
else
// display the coordinate value
sprintf
(
tmp
,
format
.
c_str
(),
value_p
[
comp
]);
if
(
strlen
(
tmp
)){
drawString
lbl
(
tmp
,
15
*
_fontFactor
);
lbl
.
draw
(
r
[
0
],
r
[
1
],
r
[
2
],
ww
,
hh
);
}
}
}
return
n
;
return
n
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment