Git Product home page Git Product logo

property_bindings's Introduction

property_bindings's People

Contributors

ogoffart avatar

Stargazers

Zhang Haifeng avatar  avatar  avatar  avatar TemetNosce avatar Joshua Leung avatar  avatar CGinMax avatar  avatar d.haijian avatar Shujaat Ali Khan avatar Albert Tavares de Almeida avatar Alexandre Gauthier avatar  avatar  avatar Dmitry Atamanov avatar Alejandro Exojo avatar  avatar  avatar nib952051 avatar Shawn Rutledge avatar Serhii Moroz avatar Catalin Moldovan avatar Cihan T. avatar WangBin avatar Dan Watkins avatar Berkus Decker avatar Ryohei Ikegami avatar Cory Bloor avatar Matthew Abbott avatar Ax avatar Joël Thieffry avatar Dmitry Ledentsov avatar Liang Qi avatar  avatar  avatar Vincent Lee avatar Tomasz Siekierda avatar Alex Denisov avatar Simon Kröger avatar Pavel Medvedev avatar

Watchers

 avatar James Cloos avatar  avatar Alejandro Exojo avatar  avatar  avatar Dan Watkins avatar Tomasz Siekierda avatar d.haijian avatar  avatar  avatar  avatar  avatar  avatar

property_bindings's Issues

property_hook doesn't trigger when grandparent properties change

I noticed that dependent properties only seem to update when dependent on independent properties, or when queried. Unfortunately, that breaks hooks with grandparents.

Hooks need to be triggered regardless of whether the new value is queried or not. Typically they exist because we need to break out of the property system and indirectly trigger a query. e.g. GraphicsRectObject::color -> GraphicsRectObject::update -> GraphicsRectObject::paint.

Example:

#include <iostream>
#include "property.h"

struct Rectangle {
  property<double> width;
  property<double> height;
  property<double> area {
    [&](){ return width * height; }
  };
};

void printA() { std::cout << "A"; }
void printB() { std::cout << "B"; }

int main() {
  Rectangle r;

  property_hook<double> hookA(
    printA, [&]{ return r.width * r.height; });

  property_hook<double> hookB(
    printB, [&]{ return r.area; });

  r.width = 5;

  std::cout << std::endl;
}

Actual Output:
A

Expected Output:
AB

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.