-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Editor] Add a way to extract the outlines of a union of rectangles #17291
Conversation
9905e16
to
f9d255c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving a few comments based on cursory first look, since this is a lot of somewhat complicated code to wrap my head around.
f9d255c
to
518c416
Compare
@Snuffleupagus If you want to try the outline algo with some pdfs and your mouse you can get this patch: |
It seems that the two test-cases added in this PR both contains left-to-right text, so please also add tests (we should hopefully have such files) for right-to-left and top-to-bottom text. |
The goal of the two tests is to just test the algorithm to get the outlines and in case of failures, we'll have a way to visualize what's wrong which should be useful. |
The goal is to be able to get these outlines to fill the shape corresponding to a text selection in order to highlight some text contents. The outlines will be used either to show selected/hovered highlights.
518c416
to
31d9b9f
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/3c347fb64e4b3ad/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/646cb0274c03bb2/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/3c347fb64e4b3ad/output.txt Total script time: 24.87 mins
Image differences available at: http://54.241.84.105:8877/3c347fb64e4b3ad/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/646cb0274c03bb2/output.txt Total script time: 34.51 mins
Image differences available at: http://54.193.163.58:8877/646cb0274c03bb2/reftest-analyzer.html#web=eq.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not looked in too much detail at the algorithm, but given that we have reference tests it should help ensure that things work as expected.
r=me, thank you!
/botio makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/5ce032ee02e5b5e/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/7ef6de1335c91d5/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/5ce032ee02e5b5e/output.txt Total script time: 10.27 mins
|
/botio-windows makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/30649cb5ef0e06d/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/7ef6de1335c91d5/output.txt Total script time: 18.14 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/30649cb5ef0e06d/output.txt Total script time: 10.38 mins
|
I think there is something wrong with the test |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/2221eeac5f3fde8/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/3bec6ee0b8df9a1/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/2221eeac5f3fde8/output.txt Total script time: 6.30 mins
|
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/3bec6ee0b8df9a1/output.txt Total script time: 17.05 mins
|
/botio-windows makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/c3f62b6e7f46c07/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/c3f62b6e7f46c07/output.txt Total script time: 11.11 mins
|
/botio-windows makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/cc2fc17eee7867c/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/cc2fc17eee7867c/output.txt Total script time: 12.49 mins
|
I finally managed to reproduce the issue locally on Windows but just one time: it's an intermittent failure with xfa tests. |
Looking above didn't |
Yes I think it's a browser regression (especially because as you pointed it out: it's failing on linux either) and I really hope that someone will have a similar issue but with a real STR. |
That could work as a temporary band-aid, assuming that's where the problem lies. The following diff is probably the smallest/easiest way to disable XFA reference tests, but please remember to open a tracking issue if we end up doing this. diff --git a/test/driver.js b/test/driver.js
index 6805017d8..312abd64b 100644
--- a/test/driver.js
+++ b/test/driver.js
@@ -446,6 +446,12 @@ class Driver {
md5FileMap.set(task.md5, task.file);
}
+ if (task.enableXfa) {
+ this.currentTask++;
+ this._nextTask();
+ return;
+ }
+
// Support *linked* test-cases for the other suites, e.g. unit- and
// integration-tests, without needing to run them as reference-tests.
if (task.type === "other") { |
yep I was writing almost the same thing with a line for logging. |
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/1c7836dcdf78445/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/1b78b580f6dafff/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/1c7836dcdf78445/output.txt Total script time: 19.53 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/1b78b580f6dafff/output.txt Total script time: 22.84 mins
|
The goal is to be able to get these outlines to fill the shape corresponding to a text selection in order to highlight some text contents. The outlines will be used either to show selected/hovered highlights.