Coder Social home page Coder Social logo

tsos's People

Contributors

brendon-boldt avatar exzackly avatar labouseur avatar tommagnusson avatar

Watchers

 avatar  avatar  avatar

tsos's Issues

Base version fix?

This is taken from source/os/canvastext.ts

The total var seems to be the length of the string in terms of width. But... it never gets changed anywhere after initiating. Then at the bottom it just returns 0.

public static draw(ctx, font, size, x, y, str) {

        var total = 0;

        var len = str.length;

        var mag = size / 25.0;

        ctx.save();

        ctx.lineCap = "round";

        ctx.lineWidth = 2.0 * mag;

        ctx.strokeStyle = "black";

        for (var i = 0; i < len; i++) {
            var c = CanvasTextFunctions.letter(str.charAt(i));
            if (!c) {
                continue;
            }
            ctx.beginPath();
            var penUp = true;
            var needStroke = 0;
            for (var j = 0; j < c.points.length; j++) {
                var a = c.points[j];
                if (a[0] === -1 && a[1] === -1) {
                    penUp = true;
                    continue;
                }
                if (penUp) {
                    ctx.moveTo( x + a[0]*mag, y - a[1]*mag);
                    penUp = false;
                } else {
                    ctx.lineTo( x + a[0]*mag, y - a[1]*mag);
                }
            }
            ctx.stroke();
            x += c.width*mag;
        }
        ctx.restore();
        return total;
    }

Find Alternative to `KeyboardEvent.which`

Mozilla developer network has marked KeyboardEvent.which to be deprecated and nonstandard, even though most browsers have implemented it (albeit in an non-unified fashion).

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which

Considerations:

  • keyCode and charCode are also both deprecated, with inconsistent browser support.
  • key is current and standard, however it does all the work that we're doing to take into account shift, locale, etc.
  • keyIdentifier seems to be a highly unimplemented and nonstandard stunt pulled by Safari (the only one to possibly implement it).
  • code might be a correct alternative. It represents which button on a device is pressed, without any consideration for what character that button is supposed to generate. This might be low level enough to keep student struggles aloft, but standard enough to work consistently in many browsers.

Other console/CLI enhancements

• Accept and display punctuation characters and symbols.
• Handle backspace appropriately.
• Implement command completion with the tab key.
• Provide command history recall via the up and down arrow keys.

Add some new shell commands.

date - displays the current date and time
whereami - displays the users current location (use your imagination)
something else interesting and creative; surprise me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.