Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
raphael
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nhn
raphael
Commits
5f08cf50
Commit
5f08cf50
authored
Mar 24, 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
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
10 deletions
+42
-10
raphael.core.js
dev/raphael.core.js
+15
-0
raphael.svg.js
dev/raphael.svg.js
+2
-1
raphael.vml.js
dev/raphael.vml.js
+3
-3
raphael-min.js
raphael-min.js
+2
-2
raphael.js
raphael.js
+20
-4
No files found.
dev/raphael.core.js
View file @
5f08cf50
...
@@ -3499,6 +3499,21 @@
...
@@ -3499,6 +3499,21 @@
delete
this
.
__set__
;
delete
this
.
__set__
;
return
out
;
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
* Paper.setSize
[ method ]
[ method ]
...
...
dev/raphael.svg.js
View file @
5f08cf50
...
@@ -1290,7 +1290,8 @@ window.Raphael && window.Raphael.svg && function(R) {
...
@@ -1290,7 +1290,8 @@ window.Raphael && window.Raphael.svg && function(R) {
};
};
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
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
,
top
=
this
.
top
,
aspectRatio
=
fit
?
"xMidYMid meet"
:
"xMinYMin"
,
aspectRatio
=
fit
?
"xMidYMid meet"
:
"xMinYMin"
,
vb
,
vb
,
...
...
dev/raphael.vml.js
View file @
5f08cf50
...
@@ -885,9 +885,9 @@ window.Raphael && window.Raphael.vml && function(R) {
...
@@ -885,9 +885,9 @@ window.Raphael && window.Raphael.vml && function(R) {
};
};
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
R
.
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
R
.
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
var
width
=
this
.
width
,
var
paperSize
=
this
.
getSize
()
,
height
=
this
.
height
,
width
=
paperSize
.
width
,
size
=
1
/
mmax
(
w
/
width
,
h
/
height
)
,
height
=
paperSize
.
height
,
H
,
W
;
H
,
W
;
if
(
fit
)
{
if
(
fit
)
{
H
=
height
/
h
;
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
...
@@ -3878,6 +3878,21 @@
...
@@ -3878,6 +3878,21 @@
delete
this
.
__set__
;
delete
this
.
__set__
;
return
out
;
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
* Paper.setSize
[ method ]
[ method ]
...
@@ -7090,7 +7105,8 @@
...
@@ -7090,7 +7105,8 @@
};
};
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
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
,
top
=
this
.
top
,
aspectRatio
=
fit
?
"xMidYMid meet"
:
"xMinYMin"
,
aspectRatio
=
fit
?
"xMidYMid meet"
:
"xMinYMin"
,
vb
,
vb
,
...
@@ -8084,9 +8100,9 @@
...
@@ -8084,9 +8100,9 @@
};
};
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
R
.
_engine
.
setViewBox
=
function
(
x
,
y
,
w
,
h
,
fit
)
{
R
.
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
R
.
eve
(
"raphael.setViewBox"
,
this
,
this
.
_viewBox
,
[
x
,
y
,
w
,
h
,
fit
]);
var
width
=
this
.
width
,
var
paperSize
=
this
.
getSize
()
,
height
=
this
.
height
,
width
=
paperSize
.
width
,
size
=
1
/
mmax
(
w
/
width
,
h
/
height
)
,
height
=
paperSize
.
height
,
H
,
W
;
H
,
W
;
if
(
fit
)
{
if
(
fit
)
{
H
=
height
/
h
;
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