ucfopen / labeling-materia-widget

Materia widget where students select items and use them to label parts of an image.
GNU Affero General Public License v3.0
1 stars 4 forks source link

Labeling: Creator and Player should use matching fonts on the labels #5

Open zachberry opened 9 years ago

zachberry commented 9 years ago

They're different currently which is unexpected

zachberry commented 8 years ago

QAing

zachberry commented 8 years ago

https://clu.cdl.ucf.edu/materia/labeling/commits/issue/579-matching-label-fonts

Fonts now match, however font sizes don't. My goal is to make those labels 100% identical. Looked into it - if you search the project for fontSize you'll find nearly identical code that modifies the fontSize as you type. These should be turned into a reusable method so that the code can be the same and use the same values.

The code should use the 15 magic value instead of the 16 magic value as 15 is what is used in the player and that is what was using Roboto Slab originally.

zachberry commented 8 years ago
/Users/zberry/Sites/nm/kogneato/devmateria/sandbox/labeling/creator.coffee:
  383   _termKeyUp = (e) ->
  384       e = window.event if not e?
  385:      fontSize = (16 - e.target.innerHTML.length / 10)
  386:      fontSize = 12 if fontSize < 12
  387:      e.target.style.fontSize = fontSize + 'px'
  388  
  389   # When typing on a term, resize the font accordingly

/Users/zberry/Sites/nm/kogneato/devmateria/sandbox/labeling/player.coffee:
  131           term.addEventListener('MSPointerDown', _mouseDownEvent, false)
  132  
  133:          fontSize = (15 - question.questions[0].text.length / 10)
  134:          fontSize = 12 if fontSize < 12
  135:          term.style.fontSize = fontSize + 'px'
  136  
  137           # Some legacy qsets store these as strings, which we certainly don't want

10 matches across 2 files
samuel-belcastro commented 8 years ago

Made a private method in the player and creator that sets font size the same way as one another. Also merged in the current labeling master branch.

To QA:

  1. Switch to branch issue/579-matching-label-fonts in the labeling repo
  2. Go to devmateria, and interact with the widget as creator and player.
    • Make sure the widget works exactly the same, and inspect the labels to make sure the font sizes are almost identical
  3. Install to Materia
  4. Repeat steps 1 and 2
WilliamRADFunk commented 7 years ago

Merged master in to incorporate the super-build mega changes.

Followed Sam's testing steps. Fonts on both creator and player look the same in both Devmateria and Materia.

LGTM