fix: remove existing bounding boxes from document on analyze (#523)
* fix: remove existing bounding boxes from document on analyze * fix: remove boundingboxes on analyze page change
This commit is contained in:
Родитель
4b85050bf0
Коммит
6a1aedfb89
|
@ -574,7 +574,9 @@ export default class PredictPage extends React.Component<IPredictPageProps, IPre
|
||||||
const prevPage = () => {
|
const prevPage = () => {
|
||||||
this.setState((prevState) => ({
|
this.setState((prevState) => ({
|
||||||
currPage: Math.max(1, prevState.currPage - 1),
|
currPage: Math.max(1, prevState.currPage - 1),
|
||||||
}));
|
}), () => {
|
||||||
|
this.imageMap.removeAllFeatures();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.state.currPage > 1) {
|
if (this.state.currPage > 1) {
|
||||||
|
@ -600,7 +602,9 @@ export default class PredictPage extends React.Component<IPredictPageProps, IPre
|
||||||
const nextPage = () => {
|
const nextPage = () => {
|
||||||
this.setState((prevState) => ({
|
this.setState((prevState) => ({
|
||||||
currPage: Math.min(prevState.currPage + 1, numPages),
|
currPage: Math.min(prevState.currPage + 1, numPages),
|
||||||
}));
|
}), () => {
|
||||||
|
this.imageMap.removeAllFeatures();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.state.currPage < numPages) {
|
if (this.state.currPage < numPages) {
|
||||||
|
@ -954,6 +958,7 @@ export default class PredictPage extends React.Component<IPredictPageProps, IPre
|
||||||
}
|
}
|
||||||
|
|
||||||
private drawPredictionResult = (): void => {
|
private drawPredictionResult = (): void => {
|
||||||
|
this.imageMap.removeAllFeatures();
|
||||||
const features = [];
|
const features = [];
|
||||||
const imageExtent = [0, 0, this.state.imageWidth, this.state.imageHeight];
|
const imageExtent = [0, 0, this.state.imageWidth, this.state.imageHeight];
|
||||||
const ocrForCurrentPage: any = this.getOcrFromAnalyzeResult(this.state.analyzeResult)[this.state.currPage - 1];
|
const ocrForCurrentPage: any = this.getOcrFromAnalyzeResult(this.state.analyzeResult)[this.state.currPage - 1];
|
||||||
|
|
Загрузка…
Ссылка в новой задаче