refactor(annotations): include bounding box info in mapped signature fields
- Added `x`, `y`, `width`, and `height` properties to form field mapping in `mapSignature`. - Preserves original form field values while enriching them with annotation coordinates. - No functional changes to annotation creation, deletion, or validation.
This commit is contained in:
@@ -321,11 +321,16 @@ function mapSignature(iJSON) {
|
||||
// formFields
|
||||
...iJSON.formFieldValues.filter(field => !field.name.includes("label")).map((field) => {
|
||||
const nameParts = field.name.split('#');
|
||||
const [x, y, width, height] = iJSON.annotations.find(iAnnot => iAnnot.id === field.name)?.bbox;
|
||||
return {
|
||||
elementId: Number(nameParts[2]),
|
||||
name: nameParts[3],
|
||||
value: field.value,
|
||||
type: field.type
|
||||
type: field.type,
|
||||
x: x,
|
||||
y: y,
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user