Skip to content

Commit

Permalink
fixes #904 large design should not hide strands on hover
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekgokhale committed Sep 21, 2023
1 parent 7395f7f commit 21b7287
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/src/middleware/edit_select_mode_change.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const selectable_css_style_non_domain_or_end = {
};

const selectable_css_style_domain = {
'filter': 'url("#shadow")',
'stroke': 'hotpink',
'stroke-width': '5pt',
// 'filter': 'url("#shadow")',
};

const selectable_css_style_end = {
Expand Down
11 changes: 10 additions & 1 deletion lib/src/view/svg_filters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ add_shadow_filter(svg.SvgSvgElement elt) {
'y': '-100%',
'width': '300%',
'height': '300%',
'filterUnits': 'userSpaceOnUse',
// 'filterUnits': 'userSpaceOnUse',

// The above line has been commented because use of this line caused the strands outside the width x height area to disappear on 'hover'.
// Reverting this change and the changes mentioned below from an old PR #480 (Fixes #20, add shadow filter for domains).
// selectable_css_style_domain has been changed in src/middleware/edit_select_mode_change.dart file
// web/scadnano-styles.css has been changed
// .selected ----> .selected:not(.domain-line)

// However, after making the above mentioned changes, the old issue of domains being highlighted with hotpink on 'hover' instead of shadow comes back. This happens because of issues in SVG Filters that cannot apply the shadow filter to a straight line. Hence, the hotpink substitute is used.
// Because of this, hovering of doamins is slightly different in appearance (hotpink) than the other selectable elements (shadow).
};
// not sure why there's no setter provided for this
// filter_element.setAttribute('filterUnits', 'userSpaceOnUse');
Expand Down
3 changes: 2 additions & 1 deletion web/scadnano-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ label + select {
fill: lightgray;
}

.selected {
/* .selected { */
.selected:not(.domain-line) {
filter: url("#shadow");
}

Expand Down

0 comments on commit 21b7287

Please sign in to comment.