Open zachberry opened 9 years ago
QAing
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.
/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
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:
issue/579-matching-label-fonts
in the labeling repoMerged 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
They're different currently which is unexpected