Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-qtype_stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-qtype_stack
Commits
51de6545
Commit
51de6545
authored
1 year ago
by
smmercuri
Browse files
Options
Downloads
Patches
Plain Diff
correct inner width and height calcs
parent
fbfb98c3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
stack/cas/castext2/blocks/jsxgraph.block.php
+3
-5
3 additions, 5 deletions
stack/cas/castext2/blocks/jsxgraph.block.php
stack/cas/castext2/blocks/parsons.block.php
+3
-6
3 additions, 6 deletions
stack/cas/castext2/blocks/parsons.block.php
with
6 additions
and
11 deletions
stack/cas/castext2/blocks/jsxgraph.block.php
+
3
−
5
View file @
51de6545
...
@@ -121,17 +121,15 @@ class stack_cas_castext2_jsxgraph extends stack_cas_castext2_block {
...
@@ -121,17 +121,15 @@ class stack_cas_castext2_jsxgraph extends stack_cas_castext2_block {
$height
=
$xpars
[
'height'
];
$height
=
$xpars
[
'height'
];
}
}
$innerwidth
=
substr
(
$width
,
-
1
)
===
'px'
?
"
$width
- 3px"
:
"100% - 3px"
;
$astyle
=
"width:calc(100% - 3px);height:calc(100% - 3px);"
;
$innerheight
=
substr
(
$width
,
-
1
)
===
'px'
?
"
$height
- 3px"
:
"100% - 3px"
;
$astyle
=
"width:calc(
$innerwidth
);height:calc(
$innerheight
);"
;
if
(
array_key_exists
(
'aspect-ratio'
,
$xpars
))
{
if
(
array_key_exists
(
'aspect-ratio'
,
$xpars
))
{
$aspectratio
=
$xpars
[
'aspect-ratio'
];
$aspectratio
=
$xpars
[
'aspect-ratio'
];
// Unset the undefined dimension, if both are defined then we have a problem.
// Unset the undefined dimension, if both are defined then we have a problem.
if
(
array_key_exists
(
'height'
,
$xpars
))
{
if
(
array_key_exists
(
'height'
,
$xpars
))
{
$astyle
=
"height:calc(
$
innerheight
);aspect-ratio:
$aspectratio
;"
;
$astyle
=
"height:calc($
100% - 3px
);aspect-ratio:
$aspectratio
;"
;
}
else
if
(
array_key_exists
(
'width'
,
$xpars
))
{
}
else
if
(
array_key_exists
(
'width'
,
$xpars
))
{
$astyle
=
"width:calc(
$innerwidth
);aspect-ratio:
$aspectratio
;"
;
$astyle
=
"width:calc(
100% - 3px
);aspect-ratio:
$aspectratio
;"
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
stack/cas/castext2/blocks/parsons.block.php
+
3
−
6
View file @
51de6545
...
@@ -115,17 +115,14 @@ class stack_cas_castext2_parsons extends stack_cas_castext2_block {
...
@@ -115,17 +115,14 @@ class stack_cas_castext2_parsons extends stack_cas_castext2_block {
// We need to define a size for the inner content.
// We need to define a size for the inner content.
$aspectratio
=
false
;
$aspectratio
=
false
;
$innerwidth
=
substr
(
$width
,
-
1
)
===
'px'
?
"
$width
- 3px"
:
"100% - 3px"
;
$astyle
=
"width:calc(100% - 3px);height:calc(100% - 3px);"
;
$innerheight
=
substr
(
$width
,
-
1
)
===
'px'
?
"
$height
- 3px"
:
"100% - 3px"
;
$astyle
=
"width:calc(
$innerwidth
);height:calc(
$innerheight
);"
;
if
(
array_key_exists
(
'aspect-ratio'
,
$xpars
))
{
if
(
array_key_exists
(
'aspect-ratio'
,
$xpars
))
{
$aspectratio
=
$xpars
[
'aspect-ratio'
];
$aspectratio
=
$xpars
[
'aspect-ratio'
];
// Unset the undefined dimension, if both are defined then we have a problem.
// Unset the undefined dimension, if both are defined then we have a problem.
if
(
array_key_exists
(
'height'
,
$xpars
))
{
if
(
array_key_exists
(
'height'
,
$xpars
))
{
$astyle
=
"height:calc(
$innerheight
);aspect-ratio:
$aspectratio
;"
;
$astyle
=
"height:calc(
100% - 3px
);aspect-ratio:
$aspectratio
;"
;
}
else
if
(
array_key_exists
(
'width'
,
$xpars
))
{
}
else
if
(
array_key_exists
(
'width'
,
$xpars
))
{
$astyle
=
"width:calc(
$innerwidth
);aspect-ratio:
$aspectratio
;"
;
$astyle
=
"width:calc(
100% - 3px
);aspect-ratio:
$aspectratio
;"
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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