{"action":"created","issue":{"url":"https://api.github.com/repos/alexrj/Slic3r/issues/2752","labels_url":"https://api.github.com/repos/alexrj/Slic3r/issues/2752/labels{/name}","comments_url":"https://api.github.com/repos/alexrj/Slic3r/issues/2752/comments","events_url":"https://api.github.com/repos/alexrj/Slic3r/issues/2752/events","html_url":"https://github.com/alexrj/Slic3r/issues/2752","id":63573533,"number":2752,"title":"Contact Z distance cannot be changed to values other than the defaults","user":{"login":"cocoknight","id":11601966,"avatar_url":"https://avatars.githubusercontent.com/u/11601966?v=3","gravatar_id":"","url":"https://api.github.com/users/cocoknight","html_url":"https://github.com/cocoknight","followers_url":"https://api.github.com/users/cocoknight/followers","following_url":"https://api.github.com/users/cocoknight/following{/other_user}","gists_url":"https://api.github.com/users/cocoknight/gists{/gist_id}","starred_url":"https://api.github.com/users/cocoknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocoknight/subscriptions","organizations_url":"https://api.github.com/users/cocoknight/orgs","repos_url":"https://api.github.com/users/cocoknight/repos","events_url":"https://api.github.com/users/cocoknight/events{/privacy}","received_events_url":"https://api.github.com/users/cocoknight/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/alexrj/Slic3r/labels/OS:%20Windows","name":"OS: Windows","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/alexrj/Slic3r/milestones/27","html_url":"https://github.com/alexrj/Slic3r/milestones/1.2.7","labels_url":"https://api.github.com/repos/alexrj/Slic3r/milestones/27/labels","id":940656,"number":27,"title":"1.2.7","description":"","creator":{"login":"alexrj","id":594957,"avatar_url":"https://avatars.githubusercontent.com/u/594957?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrj","html_url":"https://github.com/alexrj","followers_url":"https://api.github.com/users/alexrj/followers","following_url":"https://api.github.com/users/alexrj/following{/other_user}","gists_url":"https://api.github.com/users/alexrj/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrj/subscriptions","organizations_url":"https://api.github.com/users/alexrj/orgs","repos_url":"https://api.github.com/users/alexrj/repos","events_url":"https://api.github.com/users/alexrj/events{/privacy}","received_events_url":"https://api.github.com/users/alexrj/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":34,"state":"open","created_at":"2015-01-18T17:18:11Z","updated_at":"2015-03-23T20:55:08Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2015-03-22T20:40:16Z","updated_at":"2015-03-24T05:39:06Z","closed_at":null,"body":"It is not possible to use other values for the \"contact Z distance\" for support materials. If I put in a value different to the defaults it is changed back to 0 as soon as a change enter another option.\r\n(1.2.6 on Windows 7 x64)"},"comment":{"url":"https://api.github.com/repos/alexrj/Slic3r/issues/comments/85348764","html_url":"https://github.com/alexrj/Slic3r/issues/2752#issuecomment-85348764","issue_url":"https://api.github.com/repos/alexrj/Slic3r/issues/2752","id":85348764,"user":{"login":"markwal","id":10781013,"avatar_url":"https://avatars.githubusercontent.com/u/10781013?v=3","gravatar_id":"","url":"https://api.github.com/users/markwal","html_url":"https://github.com/markwal","followers_url":"https://api.github.com/users/markwal/followers","following_url":"https://api.github.com/users/markwal/following{/other_user}","gists_url":"https://api.github.com/users/markwal/gists{/gist_id}","starred_url":"https://api.github.com/users/markwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markwal/subscriptions","organizations_url":"https://api.github.com/users/markwal/orgs","repos_url":"https://api.github.com/users/markwal/repos","events_url":"https://api.github.com/users/markwal/events{/privacy}","received_events_url":"https://api.github.com/users/markwal/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T05:39:06Z","updated_at":"2015-03-24T05:39:06Z","body":"@alexrj If I understand PrintConfig.cpp correctly, there are only three options of this type: \"extruder\", \"fill_density\" and \"support_material_contact_distance\".  \"fill_density\" uses *show_value*, so takes the first *if*.  \"extruder\" only has labels, not values, so I conclude that the label lookup by index is for that case.  So I propose the following:\r\n\r\n```\r\ndiff --git a/lib/Slic3r/GUI/OptionsGroup/Field.pm b/lib/Slic3r/GUI/OptionsGroup/Field.pm\r\nindex 13b86cd..b5c8981 100644\r\n--- a/lib/Slic3r/GUI/OptionsGroup/Field.pm\r\n+++ b/lib/Slic3r/GUI/OptionsGroup/Field.pm\r\n@@ -296,7 +296,7 @@ sub set_value {\r\n                 return;\r\n             }\r\n         }\r\n-        if ($self->option->labels && $value <= $#{$self->option->labels}) {\r\n+        elsif ($self->option->labels && $value <= $#{$self->option->labels}) {\r\n             $field->SetValue($self->option->labels->[$value]);\r\n             $self->disable_change_event(0);\r\n             return;\r\n```\r\n\r\nThis also matches the logic of the constructor.\r\n\r\nWhile testing out the extruder box before and after this change I found a couple of other bugs, one Windows only, the other in both Ubuntu and Windows, but since they both repro without the fix, I think they aren't regressions of my proposal above.  I'll report them separately."}}