Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ensembl-gh-mirror
zmap
Commits
2a04b26d
Commit
2a04b26d
authored
20 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
Get major/minor scale units returned by scale drawing code.
parent
e99d1f66
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapDraw/zmapDraw.c
+17
-8
17 additions, 8 deletions
src/zmapDraw/zmapDraw.c
with
17 additions
and
8 deletions
src/zmapDraw/zmapDraw.c
+
17
−
8
View file @
2a04b26d
...
...
@@ -25,9 +25,9 @@
* Description:
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited:
Dec 13 10:32
200
4
(
rnc
)
* Last edited:
Jan 6 15:27
200
5
(
edgrif
)
* Created: Wed Oct 20 09:19:16 2004 (edgrif)
* CVS info: $Id: zmapDraw.c,v 1.2
0
200
4-12-13 10:34:47 rnc
Exp $
* CVS info: $Id: zmapDraw.c,v 1.2
1
200
5-01-07 12:31:34 edgrif
Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -113,7 +113,7 @@ void zmapDrawLine(FooCanvasGroup *group, double x1, double y1, double x2, double
FooCanvasItem
*
zmapDrawScale
(
FooCanvas
*
canvas
,
double
offset
,
double
zoom_factor
,
int
start
,
int
end
)
int
start
,
int
end
,
int
*
major_units_out
,
int
*
minor_units_out
)
{
FooCanvasItem
*
group
;
float
unit
,
subunit
;
...
...
@@ -146,7 +146,8 @@ FooCanvasItem *zmapDrawScale(FooCanvas *canvas,
/* each time through this loop unit and subunit increase by 10 times until unit exceeds cutoff,
** so we end up with a nice round number for our major ticks, and 10 minor ticks per major one. */
while
(
unit
<
cutoff
)
{
unit
*=
2
;
{
unit
*=
2
;
subunit
*=
5
;
if
(
unit
>=
cutoff
)
break
;
...
...
@@ -163,14 +164,14 @@ FooCanvasItem *zmapDrawScale(FooCanvas *canvas,
/* calculate nomial ie thousands, millions, etc */
for
(
type
=
1
,
unitType
=
0
;
iUnit
>
0
&&
1000
*
type
<
iUnit
&&
unitType
<
5
;
iUnit
>
0
&&
1000
*
type
<
iUnit
&&
unitType
<
5
;
unitType
++
,
type
*=
1000
)
;
group
=
foo_canvas_item_new
(
foo_canvas_root
(
canvas
),
foo_canvas_group_get_type
(),
"x"
,(
double
)
offset
,
"y"
,(
double
)
0
.
0
,
NULL
);
NULL
)
;
/* If the scrolled_region has been cropped, we need to crop the scalebar too */
foo_canvas_get_scroll_region
(
canvas
,
&
x1
,
&
y1
,
&
x2
,
&
y2
);
...
...
@@ -199,9 +200,17 @@ FooCanvasItem *zmapDrawScale(FooCanvas *canvas,
/* minor ticks */
for
(
pos
=
start
;
pos
<
end
;
pos
+=
iSubunit
)
zmapDrawLine
(
FOO_CANVAS_GROUP
(
group
),
35
.
0
,
pos
,
40
.
0
,
pos
,
&
black
,
1
.
0
);
{
zmapDrawLine
(
FOO_CANVAS_GROUP
(
group
),
35
.
0
,
pos
,
40
.
0
,
pos
,
&
black
,
1
.
0
)
;
}
if
(
major_units_out
)
*
major_units_out
=
iUnit
;
if
(
minor_units_out
)
*
minor_units_out
=
iSubunit
;
return
group
;
return
group
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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