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
f753aeff
Commit
f753aeff
authored
12 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
minor tweaks
parent
5f88a6c5
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
Graphics/drawAxes.cpp
+8
-3
8 additions, 3 deletions
Graphics/drawAxes.cpp
with
8 additions
and
3 deletions
Graphics/drawAxes.cpp
+
8
−
3
View file @
f753aeff
...
...
@@ -29,14 +29,14 @@ static int drawTics(drawContext *ctx, int comp, double n, std::string &format,
value_p2
[
2
]
-
value_p1
[
2
]};
double
value_l
=
norme
(
value_t
);
double
w
=
10
*
pixelfact
;
// tic marks are 10 pixels long
double
w2
=
w
*
1.
3
;
// distance to labels
double
w2
=
w
*
1.
25
;
// distance to labels
// draw label at the end of the axis
glRasterPos3d
(
p2
[
0
]
+
t
[
0
]
*
w2
,
p2
[
1
]
+
t
[
1
]
*
w2
,
p2
[
2
]
+
t
[
2
]
*
w2
);
ctx
->
drawString
(
label
);
// return number of tics in special cases
if
(
n
<
2
)
return
0
;
if
(
n
<
2
.
)
return
0
;
if
(
format
.
empty
())
return
n
;
// select perp direction automatically if it is not provided
...
...
@@ -61,7 +61,12 @@ static int drawTics(drawContext *ctx, int comp, double n, std::string &format,
double
winl
=
sqrt
(
SQU
(
win2
[
0
]
-
win1
[
0
])
+
SQU
(
win2
[
1
]
-
win1
[
1
]));
double
strl
=
drawContext
::
global
()
->
getStringWidth
(
tmp
);
if
((
n
-
1
)
*
strl
>
winl
)
n
=
(
int
)(
winl
/
strl
)
+
1
;
if
(
n
<=
1
)
n
=
2
;
if
(
n
<=
1
){
if
(
comp
<
0
)
// ruler
n
=
2
;
else
return
0
;
}
// draw n tics
double
step
=
l
/
(
double
)(
n
-
1
);
...
...
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