@@ -2,39 +2,48 @@ import { FormControlLabel, Switch } from "@material-ui/core";
22import React from "react" ;
33import { TextValidator } from "react-material-ui-form-validator" ;
44import { PixelmatchConfig } from "../../types/imageComparison" ;
5+ import { Tooltip } from "../Tooltip" ;
56import { useConfigHook } from "./useConfigHook" ;
67
78export const PixelmatchConfigForm : React . FunctionComponent = ( ) => {
89 const [ config , updateConfig ] = useConfigHook < PixelmatchConfig > ( ) ;
910
1011 return (
1112 < React . Fragment >
12- < FormControlLabel
13- label = "Allow diff dimensions"
14- control = {
15- < Switch
16- checked = { config . allowDiffDimensions }
17- onChange = { ( event , checked ) =>
18- updateConfig ( "allowDiffDimensions" , checked )
19- }
20- color = "primary"
21- name = "diffDimensionsFeature"
22- />
23- }
24- />
25- < FormControlLabel
26- label = "Ignore anti-aliasing"
27- control = {
28- < Switch
29- checked = { config . ignoreAntialiasing }
30- onChange = { ( event , checked ) =>
31- updateConfig ( "ignoreAntialiasing" , checked )
32- }
33- color = "primary"
34- name = "ignoreAntialiasing"
35- />
36- }
37- />
13+ < Tooltip
14+ title = "Enable comparison of images with different sizes."
15+ >
16+ < FormControlLabel
17+ label = "Allow diff dimensions"
18+ control = {
19+ < Switch
20+ checked = { config . allowDiffDimensions }
21+ onChange = { ( event , checked ) =>
22+ updateConfig ( "allowDiffDimensions" , checked )
23+ }
24+ color = "primary"
25+ name = "diffDimensionsFeature"
26+ />
27+ }
28+ />
29+ </ Tooltip >
30+ < Tooltip
31+ title = "Ignore detecting and ignoring anti-aliased pixels."
32+ >
33+ < FormControlLabel
34+ label = "Ignore anti-aliasing"
35+ control = {
36+ < Switch
37+ checked = { config . ignoreAntialiasing }
38+ onChange = { ( event , checked ) =>
39+ updateConfig ( "ignoreAntialiasing" , checked )
40+ }
41+ color = "primary"
42+ name = "ignoreAntialiasing"
43+ />
44+ }
45+ />
46+ </ Tooltip >
3847 < TextValidator
3948 name = "threshold"
4049 validators = { [ "minNumber:0" , "maxNumber:1" ] }
@@ -43,6 +52,7 @@ export const PixelmatchConfigForm: React.FunctionComponent = () => {
4352 margin = "dense"
4453 id = "threshold"
4554 label = "Pixel diff threshold"
55+ helperText = "The threshold of how much a pixel can deviate until it is detected as change (0-1)."
4656 type = "number"
4757 fullWidth
4858 required
0 commit comments