Skip to content

Commit a9555f8

Browse files
authored
Set z-index of synteny highlights, sort Zmenu areas in reverse of rendering order (#1131)
* Set z-index of synteny highlights, sort Zmenus in reverse of rendering order * Revert to pushing draggables onto panel areas * Restrict area unshift to SyntenyImage panel
1 parent 3dd4b1c commit a9555f8

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

htdocs/components/15_ImageMap.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,11 @@ Ensembl.Panel.ImageMap = Ensembl.Panel.Content.extend({
289289
$.each(this.coords, function (i) { c[rect[i]] = parseInt(this, 10); });
290290
}
291291

292-
panel.areas.push(c);
292+
if (panel.id == 'SyntenyImage' && !(this.klass.drag || this.klass.vdrag)) {
293+
panel.areas.unshift(c);
294+
} else {
295+
panel.areas.push(c);
296+
}
293297

294298
if (this.klass.drag || this.klass.vdrag) {
295299
// r = [ '#drag', image number, species number, species name, region, start, end, strand ]

modules/EnsEMBL/Draw/GlyphSet/Vsynteny.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ sub draw_chromosome {
643643

644644
my %coords;
645645

646+
my $highlight_z_index = 1;
646647
foreach my $box (@$highlights) {
647648
my $vc_start = $box->{'start'} * $scale + $v_offset;
648649
my $vc_end = $box->{'end'} * $scale + $v_offset;
@@ -658,6 +659,7 @@ sub draw_chromosome {
658659
$self->push($self->Rect({
659660
'x' => $vc_start,
660661
'y' => $h_offset + $box->{'side'} * ($wid+4),
662+
'z' => $highlight_z_index,
661663
'width' => $vc_end - $vc_start,
662664
'height' => $wid,
663665
'colour' => $box->{'col'},
@@ -668,6 +670,7 @@ sub draw_chromosome {
668670
'href' => $box->{'href'},
669671
'zmenu' => $box->{'zmenu'}
670672
}));
673+
$highlight_z_index += 1;
671674

672675
if ($box->{'marked'}==1 || $box->{'marked'}==-1) {
673676
$self->push($self->Rect({

0 commit comments

Comments
 (0)