Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
7360540c
Commit
7360540c
authored
May 30, 2012
by
Gary Hodgson
Committed by
Guillaume Seguin
May 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import testfiles/grid.svg
parent
663ceec4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
grid.svg
testfiles/grid.svg
+68
-0
No files found.
testfiles/grid.svg
0 → 100644
View file @
7360540c
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns=
"http://www.w3.org/2000/svg"
onload=
'init()'
width=
"150mm"
height=
"150mm"
version=
"1.1"
>
<script
type=
'text/ecmascript'
>
<![CDATA[
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if(results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
function init() {
var width = getParameterByName('width') || 150;
var height = getParameterByName('height') || 150;
var gridheight = getParameterByName('gridheight') || 10;
var gridwidth = getParameterByName('gridwidth') || 10;
var lineheight = getParameterByName('lineheight') || 0.5;
var linewidth = getParameterByName('linewidth') || 0.5;
var lineblockheight = (gridheight/2)-lineheight;
var lineblockwidth = (gridwidth/2)-linewidth;
console.log(lineblockheight,lineblockwidth)
document.getElementsByTagName('svg')[0].setAttribute('width',width+'mm');
document.getElementsByTagName('svg')[0].setAttribute('height',height+'mm');
document.getElementsByTagName('pattern')[0].setAttribute('height',gridheight+'mm');
document.getElementsByTagName('pattern')[0].setAttribute('width',gridwidth+'mm');
document.getElementsByClassName('background')[0].setAttribute('height',gridheight+'mm');
document.getElementsByClassName('background')[0].setAttribute('width',gridwidth+'mm');
var blocks = document.getElementsByClassName('block');
for (var i in blocks){
if (blocks[i] instanceof SVGRectElement){
blocks[i].setAttribute('height', lineblockheight+'mm');
blocks[i].setAttribute('width', lineblockwidth+'mm');
}
}
document.getElementsByClassName('topright')[0].setAttribute('x',lineblockwidth+'mm');
document.getElementsByClassName('bottomleft')[0].setAttribute('y',lineblockheight+'mm');
document.getElementsByClassName('bottomright')[0].setAttribute('x',lineblockwidth+'mm');
document.getElementsByClassName('bottomright')[0].setAttribute('y',lineblockheight+'mm');
}
]]>
</script>
<defs>
<pattern
id=
"grd"
patternUnits=
"userSpaceOnUse"
width=
"10mm"
height=
"10mm"
>
<rect
class=
"background"
width=
"10mm"
height=
"10mm"
fill=
"red"
/>
<rect
class=
"block topleft"
width=
"4.9mm"
height=
"4.9mm"
/>
<rect
class=
"block topright"
width=
"4.9mm"
height=
"4.9mm"
x=
"4.9mm"
/>
<rect
class=
"block bottomleft"
width=
"4.9mm"
height=
"4.9mm"
y=
"4.9mm"
/>
<rect
class=
"block bottomright"
width=
"4.9mm"
height=
"4.9mm"
x=
"4.9mm"
y=
"4.9mm"
/>
</pattern>
</defs>
<rect
height=
"100%"
width=
"100%"
fill=
"url(#grd)"
/>
</svg>
\ No newline at end of file
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