Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't sync color and transparency of image layers by default #2116

Merged
merged 2 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Full changelog
v0.16.0 (unreleased)
--------------------

* Don't sync color and transparency of image layers by default. [#2116]

* Python 2.7 and 3.5 are no longer supported. [#2075]

* Fixed bugs in the profile viewer that occurred when using the profile viewer and
Expand Down
13 changes: 13 additions & 0 deletions glue/viewers/image/qt/tests/test_data_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ def init_data(self):
def test_double_add_ignored(self):
pass

def test_update_data_processed_if_data_present(self):

# Patch for the main test of the same name - we need to explicilty set
# global_sync to True here for things to work correctly.

self.init_draw_count()
self.data_collection.append(self.data)
self.viewer.add_data(self.data)
ct0 = self.draw_count
self.viewer.state.layers[0].global_sync = True
self.data.style.color = 'blue'
assert self.draw_count > ct0

def test_slice_change_single_draw(self):

# Regression test for a bug that caused Matplotlib to draw once per
Expand Down
6 changes: 3 additions & 3 deletions glue/viewers/image/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ class ImageLayerState(BaseImageLayerState):
stretch = DDSCProperty(docstring='The stretch used to render the layer, '
'which should be one of ``linear``, '
'``sqrt``, ``log``, or ``arcsinh``')
global_sync = DDCProperty(True, docstring='Whether the color and transparency '
'should be synced with the global '
'color and transparency for the data')
global_sync = DDCProperty(False, docstring='Whether the color and transparency '
'should be synced with the global '
'color and transparency for the data')

def __init__(self, layer=None, viewer_state=None, **kwargs):

Expand Down