Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
digilib-pivaj
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel ANTELME
digilib-pivaj
Commits
78af6420
Commit
78af6420
authored
10 years ago
by
hertzhaft
Browse files
Options
Downloads
Patches
Plain Diff
oval: some constraints; fixed a bug in line.length
parent
329762b4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webapp/src/main/webapp/jquery/jquery.digilib.geometry.js
+7
-1
7 additions, 1 deletion
webapp/src/main/webapp/jquery/jquery.digilib.geometry.js
webapp/src/main/webapp/jquery/jquery.digilib.measure.js
+8
-1
8 additions, 1 deletion
webapp/src/main/webapp/jquery/jquery.digilib.measure.js
with
15 additions
and
2 deletions
webapp/src/main/webapp/jquery/jquery.digilib.geometry.js
+
7
−
1
View file @
78af6420
...
...
@@ -151,6 +151,12 @@
top
:
this
.
y
});
};
// move this position to another
that
.
moveTo
=
function
(
other
)
{
this
.
x
=
other
.
x
;
this
.
y
=
other
.
y
;
return
this
;
};
// adjust this position so that is is inside rect
that
.
clipTo
=
function
(
rect
)
{
var
p1
=
rect
.
getPt1
();
...
...
@@ -285,7 +291,7 @@
that
.
length
=
function
(
length
)
{
var
dist
=
this
.
dist
();
if
(
length
==
null
)
{
return
this
.
dist
;
return
dist
;
}
var
ratio
=
length
/
dist
;
this
.
dx
*=
ratio
;
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/webapp/jquery/jquery.digilib.measure.js
+
8
−
1
View file @
78af6420
...
...
@@ -1251,7 +1251,14 @@
var
mid3
=
side3
.
mid
();
var
axis0
=
side0
.
parallel
(
mid3
);
// short axis
var
axis1
=
side1
.
parallel
(
mid0
);
// long axis
var
handle
=
axis1
.
perpendicularPoint
(
p
[
3
]);
// drag point projected on long axis
var
maxDiam
=
axis0
.
length
()
-
1
;
// maximal diameter for small circles
var
handle
=
axis1
.
perpendicularPoint
(
p
[
3
]);
// drag point projected on long axis
console
.
debug
(
handle
.
distance
(
mid2
),
maxDiam
);
if
(
handle
.
distance
(
mid0
)
>
axis1
.
length
())
{
// constrain handle
handle
.
moveTo
(
mid2
);
}
else
if
(
handle
.
distance
(
mid2
)
>
maxDiam
)
{
handle
.
moveTo
(
geom
.
line
(
mid2
,
handle
).
length
(
maxDiam
).
point
());
}
var
m1
=
handle
.
mid
(
mid2
);
// midpoints of the small circles
var
m2
=
axis0
.
mirror
(
m1
);
var
rad1
=
m1
.
distance
(
mid2
);
// radius of the small circles
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment