Skip to content

Commit 9226713

Browse files
Need to keep assignment to image so subsequent chained methods can use updated image.
1 parent efdf409 commit 9226713

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public PageSnapshot highlight(WebElement element) {
5151
*/
5252
public PageSnapshot highlight(WebElement element, Color color, int lineWidth) {
5353
try {
54-
ImageProcessor.highlight(image, new Coordinates(element, devicePixelRatio), color, lineWidth);
54+
image = ImageProcessor.highlight(image, new Coordinates(element, devicePixelRatio), color, lineWidth);
5555
} catch (RasterFormatException rfe) {
5656
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE, rfe);
5757
}
@@ -93,7 +93,7 @@ public PageSnapshot highlightWithText(WebElement element, Color elementColor, in
9393
try {
9494
highlight(element, elementColor, 0);
9595
Coordinates coords = new Coordinates(element, devicePixelRatio);
96-
ImageProcessor.addText(image, coords.getX(), coords.getY() - textFont.getSize() / 2, text, textColor, textFont);
96+
image = ImageProcessor.addText(image, coords.getX(), coords.getY() - textFont.getSize() / 2, text, textColor, textFont);
9797
} catch (RasterFormatException rfe) {
9898
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE, rfe);
9999
}

src/main/java/com/assertthat/selenium_shutterbug/core/Snapshot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public T withThumbnail(double scale) {
185185
* @return instance of type Snapshot
186186
*/
187187
public T monochrome() {
188-
ImageProcessor.convertToGrayAndWhite(this.image);
188+
this.image = ImageProcessor.convertToGrayAndWhite(this.image);
189189
return self();
190190
}
191191

0 commit comments

Comments
 (0)