Skip to content

Commit 99dd59f

Browse files
committed
fix Graphics3D
1 parent efc1a65 commit 99dd59f

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

mathics/builtin/graphics.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ class Graphics(Builtin):
470470
def apply_makeboxes(self, content, evaluation, options):
471471
"""MakeBoxes[%(name)s[content_, OptionsPattern[%(name)s]],
472472
StandardForm|TraditionalForm|OutputForm]"""
473-
474473
def convert(content):
475474
head = content.get_head_name()
476475

@@ -511,11 +510,9 @@ def convert(content):
511510
#box_name = "Graphics" + self.box_suffix
512511
from mathics.builtin.graphics3d import Graphics3DBox, Graphics3D
513512
if type(self) is Graphics:
514-
ret = GraphicsBox(convert(content), *options_to_rules(options))
515-
return ret
516-
elif type(self) is Graphics3D:
517-
ret = Graphics3DBox(convert(content), *options_to_rules(options))
518-
return ret
513+
return GraphicsBox(convert(content), *options_to_rules(options))
514+
elif type(self) is Graphics3D:
515+
return Graphics3DBox(convert(content), *options_to_rules(options))
519516

520517

521518
class _GraphicsElement(InstancableBuiltin):
@@ -2774,7 +2771,6 @@ class _GraphicsElements(object):
27742771
def __init__(self, content, evaluation):
27752772
self.evaluation = evaluation
27762773
self.elements = []
2777-
27782774
builtins = evaluation.definitions.builtin
27792775

27802776
def get_options(name):
@@ -2801,9 +2797,6 @@ def stylebox_style(style, specs):
28012797

28022798
new_style.set_option(name, create(style.graphics, expr))
28032799
else:
2804-
print("stylebox_style")
2805-
print("spec=", spec)
2806-
print("head_name=", head_name)
28072800
raise BoxConstructError
28082801
return new_style
28092802

@@ -3875,6 +3868,7 @@ class Large(Builtin):
38753868
style_options = system_symbols_dict(
38763869
{
38773870
"FontColor": _style,
3871+
"ImageSizeMultipliers": (lambda *x: x[1])
38783872
}
38793873
)
38803874

mathics/core/evaluation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ def evaluate():
342342
self.definitions.add_rule(
343343
"Out", Rule(Expression("Out", line_no), stored_result)
344344
)
345+
345346
if self.last_eval != self.SymbolNull:
346347
if check_io_hook("System`$PrePrint"):
347348
self.last_eval = Expression(

mathics/core/expression.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,9 @@ def format_expr(expr):
451451
if head in formats:
452452
expr = expr.do_format(evaluation, form)
453453
elif (head != 'System`NumberForm' and not expr.is_atom() and
454-
head != 'System`Graphics'):
454+
head != 'System`Graphics' and
455+
head != 'System`Graphics3D'):
456+
# print("Not inside graphics or numberform, and not is atom")
455457
new_leaves = [leaf.do_format(evaluation, form)
456458
for leaf in expr.leaves]
457459
formathead = expr.head.do_format(evaluation, form)

0 commit comments

Comments
 (0)