-
Notifications
You must be signed in to change notification settings - Fork 68
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
D4 does not display faces correctly #6
Comments
+1 |
Ty for the report. I'm currently moving to a new city so time is short. I try to look into this in a few weeks. If you find the bug until I had time, feel free to submit a pull request! :) |
was this fixed? |
I tried to fix it but failed misserably.. I think sometimes it works and sometimes it doesnt and thats my problem trying to modify the faces , also why is there a 0 array the other dice dont have that: |
any news about this? |
Part of shift_dice_faces() from the original dice.js had not been brought into this adaptation. I've attempted to port it over. It seems to work in my tests, but I am not 100% confident given I haven't fully understood the underlying code.
Feel free to try the change in my pull request. It's a few lines added to |
I have tested the fix by Mark (@liffiton) and found that it was almost there - see my comments on his PR #8 . Removing the second restriction in the if-condition as I suggest seems to work for all cases. The fix probably isn't in the correct location in a design sense and should be moved back into the DiceD4 class somehow - probably there should be an override-able method in the base class for updating materials for a given face value. |
Thanks for the help guys! Feel free the resolve the merge conflicts @tim-duncan and I would merge your PR :) |
Please try it out, I just merged @eipporko 's PR. If that is enough, I would close @tim-duncan 's PR then. |
The 4-sided dice does not display its faces properly. The number at the top of the pyramid is often different for each face - it should be the same number specified in the value property.
To reproduce...simply switch out the D6 and replace them with D4 objects in the rolling.html example. Lines 105 & 106 become:
The throw should have dice displaying one each of red=1, yellow=2, green=3 & blue=4 at the top. Instead the actual throw shows red=1 and yellow=2 as expected, but the blue and green dice have mismatched numbers:

The text was updated successfully, but these errors were encountered: