Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
b416a072
Commit
b416a072
authored
Sep 05, 2016
by
Maxime Perrotin
Browse files
Make placements more accurate
parent
b18720bd
Changes
1
Show whitespace changes
Inline
Side-by-side
opengeode/opengeode.py
View file @
b416a072
...
...
@@ -1142,9 +1142,12 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
return
subscene
def
place_symbol
(
self
,
item_type
,
parent
,
pos
=
None
):
def
place_symbol
(
self
,
item_type
,
parent
,
pos
=
None
,
rect
=
None
):
''' Draw a symbol on the scene '''
item
=
item_type
()
if
rect
is
not
None
:
# Optionally size the new item
item
.
set_shape
(
rect
.
width
(),
rect
.
height
())
# Add the item to the scene
if
item
not
in
self
.
items
():
self
.
addItem
(
item
)
...
...
@@ -1286,9 +1289,9 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
ACTIONS
.
get
(
self
.
context
,
[]))
def
add_symbol
(
sort
,
rect
):
s
ymb
=
self
.
place_symbol
(
sort
,
parent
=
None
,
pos
=
rect
.
topLeft
())
if
symb
.
default_size
==
"any"
:
symb
.
resize_item
(
rect
)
s
ize
=
rect
if
sort
.
default_size
==
"any"
else
None
symb
=
self
.
place_symbol
(
sort
,
parent
=
None
,
pos
=
rect
.
topLeft
(),
rect
=
size
)
def
setup_action
(
sort
):
name
=
sort
.
__name__
...
...
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