Skip to content

Commit

Permalink
Avoid not allowing numeric 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 26, 2024
1 parent 9ab146c commit 9c93a5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ export default (pluginManager: PluginManager) => {
const location = parseLocString(highlight, refName =>
isValidRefName(refName, assembly),
)
if (location?.start && location?.end) {
if (location?.start !== undefined && location?.end !== undefined) {
location.assemblyName = assembly

view.setHighlight(location)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,17 @@ export const OverviewHighlight = observer(function OverviewHighlight({

// coords
const mapCoords = (r: ParsedLocStringA) => {
const s =
overview.bpToPx({
...r,
coord: r.reversed ? r.end : r.start,
}) || 0

const e =
overview.bpToPx({
...r,
coord: r.reversed ? r.start : r.end,
}) || 0
const s = overview.bpToPx({
...r,
coord: r.reversed ? r.end : r.start,
})

return s && e
const e = overview.bpToPx({
...r,
coord: r.reversed ? r.start : r.end,
})

return s !== undefined && e != undefined
? {
width: Math.abs(e - s),
left: s + cytobandOffset,
Expand Down

0 comments on commit 9c93a5a

Please sign in to comment.