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
f9382c5a
Commit
f9382c5a
authored
19 years ago
by
rds
Browse files
Options
Downloads
Patches
Plain Diff
make the dna drawing work correctly...
parent
1509f96a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/zmapDraw/zmapDraw.c
+28
-27
28 additions, 27 deletions
src/zmapDraw/zmapDraw.c
src/zmapDraw/zmapDraw_P.h
+4
-3
4 additions, 3 deletions
src/zmapDraw/zmapDraw_P.h
with
32 additions
and
30 deletions
src/zmapDraw/zmapDraw.c
+
28
−
27
View file @
f9382c5a
...
...
@@ -28,9 +28,9 @@
* Exported functions: See ZMap/zmapDraw.h
*
* HISTORY:
* Last edited: Nov 1
4
10:
58
2005 (rds)
* Last edited: Nov 1
6
10:
32
2005 (rds)
* Created: Wed Oct 20 09:19:16 2004 (edgrif)
* CVS info: $Id: zmapDraw.c,v 1.3
7
2005-11-1
4
1
2:04:31
rds Exp $
* CVS info: $Id: zmapDraw.c,v 1.3
8
2005-11-1
6
1
0:32:45
rds Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -367,13 +367,9 @@ void zMapDrawToolTipSetPosition(FooCanvasGroup *tooltip, double x, double y, cha
*
* To make a multicolour highlight box just #define ZMAP_DRAW_HIGHLIGHT_MULTICOLOR
*/
void
zMapDrawHighlightTextRegion
(
FooCanvasGroup
*
grp
,
int
y1Idx
,
int
y2Idx
,
int
full_str_length
,
int
drawn_str_length
,
int
offset
,
double
column_width
)
void
zMapDrawHighlightTextRegion
(
FooCanvasGroup
*
grp
,
int
y1Idx
,
int
y2Idx
,
FooCanvasItem
*
textItem
)
{
FooCanvasPoints
*
points
=
NULL
;
GList
*
lines
=
NULL
;
...
...
@@ -381,20 +377,23 @@ void zMapDrawHighlightTextRegion(FooCanvasGroup *grp,
double
offsetX1
,
offsetX2
,
offsetY1
,
offsetY2
;
double
minX
,
maxX
,
dlength
,
chrWidth
;
int
i
,
y1mod
,
y2mod
;
ZMapDrawTextRowData
trd
=
NULL
;
zMapAssert
(
textItem
&&
(
trd
=
zMapDrawGetTextItemData
(
textItem
)));
gdk_color_parse
(
"red"
,
&
color
);
lines
=
grp
->
item_list
;
points
=
foo_canvas_points_new
(
2
);
y1mod
=
(
y1Idx
-
offset
)
%
full_str_l
ength
;
y2mod
=
(
y2Idx
-
offset
)
%
full_str_l
ength
;
y1mod
=
(
y1Idx
-
trd
->
sequenceOffset
)
%
trd
->
fullStrL
ength
;
y2mod
=
(
y2Idx
-
trd
->
sequenceOffset
)
%
trd
->
fullStrL
ength
;
dlength
=
(
double
)
full_str_l
ength
;
chrWidth
=
column
_w
idth
/
drawn_str_l
ength
;
dlength
=
(
double
)
trd
->
fullStrL
ength
;
chrWidth
=
trd
->
column
W
idth
/
trd
->
drawnStrL
ength
;
minX
=
chrWidth
/
4
;
/* Also used to get half way between characters */
maxX
=
column
_w
idth
;
/* -/+ minX ?? */
maxX
=
trd
->
column
W
idth
;
/* -/+ minX ?? */
offsetX1
=
((
double
)
y1mod
)
*
chrWidth
+
minX
;
offsetX2
=
((
double
)
y2mod
)
*
chrWidth
+
minX
;
...
...
@@ -557,7 +556,6 @@ ZMapDrawTextRowData zMapDrawGetTextItemData(FooCanvasItem *item)
return
trd
;
}
FooCanvasItem
*
zMapDrawRowOfText
(
FooCanvasGroup
*
group
,
PangoFontDescription
*
fixed_font
,
char
*
fullText
,
...
...
@@ -566,32 +564,31 @@ FooCanvasItem *zMapDrawRowOfText(FooCanvasGroup *group,
FooCanvasItem
*
item
=
NULL
;
char
*
item_text
=
NULL
;
ZMapDrawTextRowData
trd
=
NULL
;
int
char_count
,
max_chars
,
text_width
=
8
;
int
char_count
,
max_chars
,
text_width
=
8
,
curr_idx
;
/* Make a ZMapDrawTextRowData object to attach to the text */
trd
=
g_new0
(
ZMapDrawTextRowDataStruct
,
1
);
iterator
->
y
=
iterator
->
iteration
*
iterator
->
text_height
;
iterator
->
y
+=
iterator
->
offset
;
curr_idx
=
iterator
->
iteration
*
iterator
->
cols
;
curr_idx
+=
iterator
->
offset
_start
;
iterator
->
seq_start
=
iterator
->
iteration
*
iterator
->
cols
;
iterator
->
seq_start
+=
iterator
->
offset
;
iterator
->
y
=
(
double
)
curr_idx
;
trd
->
textWriteOffset
=
iterator
->
seq_start
;
trd
->
fullStrLength
=
iterator
->
cols
;
trd
->
sequenceOffset
=
iterator
->
offset
;
trd
->
rowOffset
=
curr_idx
;
// +
iterator->seq_start
- 1
;
trd
->
fullStrLength
=
iterator
->
cols
;
trd
->
sequenceOffset
=
iterator
->
offset
_start
;
max_chars
=
floor
(
MAX_TEXT_COLUMN_WIDTH
/
text_width
)
-
3
;
/* we add 3 dots (...) */
char_count
=
MIN
(
iterator
->
cols
,
max_chars
);
if
(
fullText
[
iterator
->
seq_start
])
if
(
fullText
[
curr_idx
])
{
trd
->
drawnStrLength
=
(
char_count
>=
iterator
->
cols
?
iterator
->
cols
:
char_count
+
3
);
if
(
char_count
>=
iterator
->
cols
)
item_text
=
g_strndup
(
&
(
fullText
[
iterator
->
seq_start
]),
iterator
->
cols
);
item_text
=
g_strndup
(
&
(
fullText
[
curr_idx
]),
iterator
->
cols
);
else
item_text
=
g_strdup_printf
(
"%s..."
,
g_strndup
(
&
(
fullText
[
iterator
->
seq_start
]),
char_count
)
g_strndup
(
&
(
fullText
[
curr_idx
]),
char_count
)
);
}
...
...
@@ -629,15 +626,19 @@ FooCanvasItem *zMapDrawRowOfText(FooCanvasGroup *group,
foo_canvas_item_set
(
item
,
"clip"
,
TRUE
,
"clip_width"
,
trd
->
columnWidth
,
"clip_height"
,
(
double
)
iterator
->
line_height
,
"clip_height"
,
(
double
)
iterator
->
n_bases
,
NULL
);
foo_canvas_item_raise_to_top
(
item
);
g_free
(
item_text
);
#ifdef PREFIX_DNA_WITH_NUMBERS
drawRowBounds
(
item
);
g_free
(
item_text2
);
#endif
}
// iterator->x = ZMAP_WINDOW_TEXT_BORDER; /* reset this */
...
...
This diff is collapsed.
Click to expand it.
src/zmapDraw/zmapDraw_P.h
+
4
−
3
View file @
f9382c5a
...
...
@@ -27,9 +27,9 @@
*
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited: Nov 1
4
1
0
:4
1
2005 (rds)
* Last edited: Nov 1
5
1
4
:4
7
2005 (rds)
* Created: Mon Jul 18 09:14:38 2005 (rds)
* CVS info: $Id: zmapDraw_P.h,v 1.
2
2005-11-1
4
1
2:04:5
5 rds Exp $
* CVS info: $Id: zmapDraw_P.h,v 1.
3
2005-11-1
6
1
0:32:4
5 rds Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_DRAW_P_H
...
...
@@ -39,6 +39,7 @@
#include
<glib.h>
#include
<math.h>
#include
<ZMap/zmapDraw.h>
#include
<ZMap/zmapUtils.h>
#define ZMAP_SCALE_MINORS_PER_MAJOR 10
#define ZMAP_FORCE_FIVES TRUE
...
...
@@ -74,10 +75,10 @@ typedef struct _ZMapScaleBarStruct
double
bottom
;
}
ZMapScaleBarStruct
,
*
ZMapScaleBar
;
static
ZMapScaleBar
createScaleBar_start_end_zoom_height
(
double
start
,
double
end
,
double
zoom
,
double
line
);
static
void
drawScaleBar
(
ZMapScaleBar
scaleBar
,
FooCanvasGroup
*
group
,
PangoFontDescription
*
font
);
static
void
destroyScaleBar
(
ZMapScaleBar
scaleBar
);
#endif
/* ZMAP_DRAW_P_H */
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