Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
殷洪(管理员)
/
raphael
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5f08cf50
authored
Mar 23, 2014
by
Tomas Alabes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setViewBox() does not work properly for papers, having size in percents
parent
ab5fa489
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
8 deletions
+40
-8
dev/raphael.core.js
+15
-0
dev/raphael.svg.js
+2
-1
dev/raphael.vml.js
+3
-3
raphael-min.js
+0
-0
raphael.js
+20
-4
No files found.
dev/raphael.core.js
View file @
5f08cf50
...
...
@@ -3500,6 +3500,21 @@
return
out
;
};
/*\
* Paper.getSize
[ method ]
**
* Obtains current paper actual size.
**
= (object)
\*/
paperproto
.
getSize
=
function
()
{
var
container
=
this
.
canvas
.
parentNode
;
return
{
width
:
container
.
offsetWidth
,
height
:
container
.
offsetHeight
};
};
/*\
* Paper.setSize
[ method ]
**
...
...
dev/raphael.svg.js
View file @
5f08cf50
...
...
@@ -1290,7 +1290,8 @@ window.Raphael && window.Raphael.svg && function(R) {
};
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
var
size
=
mmax
(
w
/
this
.
width
,
h
/
this
.
height
),
var
paperSize
=
this
.
getSize
(),
size
=
mmax
(
w
/
paperSize
.
width
,
h
/
paperSize
.
height
),
top
=
this
.
top
,
aspectRatio
=
fit
?
"xMidYMid meet"
:
"xMinYMin"
,
vb
,
...
...
dev/raphael.vml.js
View file @
5f08cf50
...
...
@@ -885,9 +885,9 @@ window.Raphael && window.Raphael.vml && function(R) {
};
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
R
.
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
var
width
=
this
.
width
,
height
=
this
.
height
,
size
=
1
/
mmax
(
w
/
width
,
h
/
height
)
,
var
paperSize
=
this
.
getSize
()
,
width
=
paperSize
.
width
,
height
=
paperSize
.
height
,
H
,
W
;
if
(
fit
)
{
H
=
height
/
h
;
...
...
raphael-min.js
View file @
5f08cf50
This source diff could not be displayed because it is too large. You can
view the blob
instead.
raphael.js
View file @
5f08cf50
...
...
@@ -3879,6 +3879,21 @@
return
out
;
};
/*\
* Paper.getSize
[ method ]
**
* Obtains current paper actual size.
**
= (object)
\*/
paperproto
.
getSize
=
function
()
{
var
container
=
this
.
canvas
.
parentNode
;
return
{
width
:
container
.
offsetWidth
,
height
:
container
.
offsetHeight
};
};
/*\
* Paper.setSize
[ method ]
**
...
...
@@ -7090,7 +7105,8 @@
};
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
var
size
=
mmax
(
w
/
this
.
width
,
h
/
this
.
height
),
var
paperSize
=
this
.
getSize
(),
size
=
mmax
(
w
/
paperSize
.
width
,
h
/
paperSize
.
height
),
top
=
this
.
top
,
aspectRatio
=
fit
?
"xMidYMid meet"
:
"xMinYMin"
,
vb
,
...
...
@@ -8084,9 +8100,9 @@
};
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
R
.
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
var
width
=
this
.
width
,
height
=
this
.
height
,
size
=
1
/
mmax
(
w
/
width
,
h
/
height
)
,
var
paperSize
=
this
.
getSize
()
,
width
=
paperSize
.
width
,
height
=
paperSize
.
height
,
H
,
W
;
if
(
fit
)
{
H
=
height
/
h
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment