Skip to content

Commit c407412

Browse files
committed
Added threshold for highlight duratios < 0
1 parent 7d2c44f commit c407412

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ function bitmap(width, height, byteWidth, bitsPerPixel, bytesPerPixel, image) {
2020
module.exports.screen.highlight = function(x, y, width, height, duration, opacity) {
2121
let highlightOpacity = (opacity < 0) ? 0 : opacity;
2222
highlightOpacity = (highlightOpacity > 1) ? 1 : highlightOpacity;
23+
const highlightDuration = (duration < 0) ? 0 : duration;
2324

24-
libnut.highlight(x, y, width, height, duration, highlightOpacity);
25+
libnut.highlight(x, y, width, height, highlightDuration, highlightOpacity);
2526
}
2627

2728
module.exports.screen.capture = function(x, y, width, height) {

0 commit comments

Comments
 (0)