mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-08 05:48:11 +08:00
fix bugs w/ abs/floor
This commit is contained in:
@@ -48,8 +48,8 @@ export default class Truncate extends Component {
|
|||||||
maxSize,
|
maxSize,
|
||||||
params,
|
params,
|
||||||
length < lastLength
|
length < lastLength
|
||||||
? length / 2
|
? Math.floor(length / 2)
|
||||||
: Math.floor(Math.floor((length - lastLength) / 2) + lastLength),
|
: Math.floor(Math.abs(length - lastLength) / 2) + lastLength,
|
||||||
length,
|
length,
|
||||||
close
|
close
|
||||||
);
|
);
|
||||||
@@ -63,7 +63,7 @@ export default class Truncate extends Component {
|
|||||||
str,
|
str,
|
||||||
maxSize,
|
maxSize,
|
||||||
params,
|
params,
|
||||||
Math.floor((lastLength - length) / 2) + length,
|
Math.floor(Math.abs(lastLength - length) / 2) + length,
|
||||||
length,
|
length,
|
||||||
close
|
close
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user